Class: EnumRecords::EnumNameCapturer

Inherits:
Object
  • Object
show all
Defined in:
lib/enum_records.rb

Instance Method Summary collapse

Constructor Details

#initialize(definer, &block) ⇒ EnumNameCapturer

Returns a new instance of EnumNameCapturer.



98
99
100
101
# File 'lib/enum_records.rb', line 98

def initialize definer, &block
  @definer = definer
  instance_eval(&block)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_sym, *args, &block) ⇒ Object



103
104
105
# File 'lib/enum_records.rb', line 103

def method_missing method_sym, *args, &block
  @definer.add_new_enum method_sym, args[0]
end