Module: DataForge::DSL::Attributes
- Included in:
- File::CSV::CSVRecordFileDefinition
- Defined in:
- lib/data_forge/dsl/attributes.rb
Instance Method Summary collapse
Instance Method Details
#define_attribute(name) ⇒ Object
5 6 7 8 9 10 11 |
# File 'lib/data_forge/dsl/attributes.rb', line 5 def define_attribute(name) define_method name do |*args| return instance_variable_get "@#{name}" if args.count.zero? instance_variable_set "@#{name}", args.first end end |