Class: RakeFactory::ParameterView
- Inherits:
-
Object
- Object
- RakeFactory::ParameterView
- Defined in:
- lib/rake_factory/parameter_view.rb
Instance Attribute Summary collapse
-
#task ⇒ Object
readonly
Returns the value of attribute task.
Instance Method Summary collapse
-
#initialize(task) ⇒ ParameterView
constructor
A new instance of ParameterView.
Constructor Details
#initialize(task) ⇒ ParameterView
Returns a new instance of ParameterView.
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/rake_factory/parameter_view.rb', line 5 def initialize(task) self.instance_eval do task.class.parameter_set.each do |parameter| define_singleton_method parameter.reader_method do task.send(parameter.reader_method) end if parameter.configurable? define_singleton_method parameter.writer_method do |value| task.send(parameter.writer_method, value) end end end end end |
Instance Attribute Details
#task ⇒ Object (readonly)
Returns the value of attribute task.
3 4 5 |
# File 'lib/rake_factory/parameter_view.rb', line 3 def task @task end |