Module: Croesus::DSLHelpers::ClassMethods
- Defined in:
- lib/croesus/dsl/helpers.rb
Instance Method Summary collapse
Instance Method Details
#setter(*method_names) ⇒ Object
27 28 29 30 31 32 33 |
# File 'lib/croesus/dsl/helpers.rb', line 27 def setter(*method_names) method_names.each do |name| send :define_method, name do |data| instance_variable_set "@#{name}".to_sym, data end end end |
#varags_setter(*method_names) ⇒ Object
35 36 37 38 39 40 41 |
# File 'lib/croesus/dsl/helpers.rb', line 35 def varags_setter(*method_names) method_names.each do |name| send :define_method, name do |*data| instance_variable_set "@#{name}".to_sym, data end end end |