Module: Attribute
- Included in:
- Namespace, Query, Report, Transformer
- Defined in:
- lib/athergin/attribute.rb
Instance Method Summary collapse
Instance Method Details
#attribute(*names) ⇒ Object
2 3 4 5 6 7 8 9 |
# File 'lib/athergin/attribute.rb', line 2 def attribute(*names) names.each do |name| instance_variable_name = :"@#{ name }" define_method name do |value=nil| value ? instance_variable_set(instance_variable_name,value) : instance_variable_get(instance_variable_name) end end end |