module Contextuable
  extend ActiveSupport::Concern

  included do
    attr_accessor :context
  end

  def method_missing(m, *args, &block)
    if m.to_s.start_with?('context_') && m.to_s.end_with?('?')
      context == m.match(/context_(.*)\?/)[1]
    else
      super
    end
  end
end
