Module: Activator::ClassMethods

Defined in:
lib/activator.rb

Constant Summary collapse

@@used_activator_field =
:active

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args) ⇒ Object



19
20
21
22
23
24
25
# File 'lib/activator.rb', line 19

def method_missing(name, *args)
  if name == used_activator_field
    activator_search_item
  else
    super
  end
end

Instance Method Details

#activator_field(name) ⇒ Object



11
12
13
# File 'lib/activator.rb', line 11

def activator_field(name)
  @@used_activator_field = name.to_sym
end

#used_activator_fieldObject



15
16
17
# File 'lib/activator.rb', line 15

def used_activator_field
  @@used_activator_field
end