Class: ConcernBuilder
- Inherits:
-
Object
- Object
- ConcernBuilder
- Includes:
- OptionsParser
- Defined in:
- lib/concern_builder.rb,
lib/concern_builder/version.rb
Defined Under Namespace
Modules: OptionsParser
Constant Summary collapse
- VERSION =
'0.0.3'
Instance Attribute Summary collapse
-
#attr_names ⇒ Object
readonly
Returns the value of attribute attr_names.
-
#methods_def ⇒ Object
readonly
Returns the value of attribute methods_def.
Attributes included from OptionsParser
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize(attr_names, instance, options = {}) ⇒ ConcernBuilder
constructor
A new instance of ConcernBuilder.
Methods included from OptionsParser
Constructor Details
#initialize(attr_names, instance, options = {}) ⇒ ConcernBuilder
Returns a new instance of ConcernBuilder.
12 13 14 15 16 17 18 |
# File 'lib/concern_builder.rb', line 12 def initialize(attr_names, instance, = {}) @attr_names = attr_names @instance = instance @options = @methods_def = [] init end |
Instance Attribute Details
#attr_names ⇒ Object (readonly)
Returns the value of attribute attr_names.
10 11 12 |
# File 'lib/concern_builder.rb', line 10 def attr_names @attr_names end |
#methods_def ⇒ Object (readonly)
Returns the value of attribute methods_def.
10 11 12 |
# File 'lib/concern_builder.rb', line 10 def methods_def @methods_def end |
Instance Method Details
#build ⇒ Object
20 21 22 23 24 |
# File 'lib/concern_builder.rb', line 20 def build methods_def.each do |method_def| @instance.module_eval(method_def, __FILE__, __LINE__ + 1) end end |