Module: QuestionMarkMethod

Defined in:
lib/question_mark_method.rb

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_name) ⇒ Object



2
3
4
5
6
7
8
# File 'lib/question_mark_method.rb', line 2

def method_missing(method_name)
  if md = /\?$/.match(method_name.to_s)
    return_boolean_value_of_attribute_related_with(md.pre_match)
  else
    super
  end
end

Class Method Details

.included(base) ⇒ Object



10
11
12
# File 'lib/question_mark_method.rb', line 10

def self.included(base)
  base.extend(ClassMethods)
end