Module: Blazing::DSLSetter
- Included in:
- Config
- Defined in:
- lib/blazing/dsl_setter.rb
Instance Method Summary collapse
-
#dsl_setter(*names) ⇒ Object
DSL Setter helper method.
Instance Method Details
#dsl_setter(*names) ⇒ Object
DSL Setter helper method
6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/blazing/dsl_setter.rb', line 6 def dsl_setter(*names) names.each do |name| class_eval <<-EVAL def #{name}(value = nil) if value instance_variable_set("@#{name}", value) else instance_variable_get("@#{name}") end end EVAL end end |