Module: FullTime::DSL
- Included in:
- Certificate, Company, Profile, Project, University
- Defined in:
- lib/full_time/dsl.rb
Instance Method Summary collapse
Instance Method Details
#dsl_attr_accessor(*attributes) ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 |
# File 'lib/full_time/dsl.rb', line 3 def dsl_attr_accessor(*attributes) attributes.each do |attr| define_method attr do |*args| case args.size when 0 then instance_variable_get("@#{attr}") when 1 then instance_variable_set("@#{attr}", args.first) else raise ArgumentError, "wrong number of arguments (#{args.size} for 0..1)" end end end end |