Class: Attachs::Builder
- Inherits:
-
Object
- Object
- Attachs::Builder
- Defined in:
- lib/attachs/builder.rb
Instance Attribute Summary collapse
-
#concern ⇒ Object
readonly
Returns the value of attribute concern.
-
#model ⇒ Object
readonly
Returns the value of attribute model.
Instance Method Summary collapse
- #define(attribute, options = {}) ⇒ Object
-
#initialize(model) ⇒ Builder
constructor
A new instance of Builder.
Constructor Details
Instance Attribute Details
#concern ⇒ Object (readonly)
Returns the value of attribute concern.
4 5 6 |
# File 'lib/attachs/builder.rb', line 4 def concern @concern end |
#model ⇒ Object (readonly)
Returns the value of attribute model.
4 5 6 |
# File 'lib/attachs/builder.rb', line 4 def model @model end |
Instance Method Details
#define(attribute, options = {}) ⇒ Object
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/attachs/builder.rb', line 14 def define(attribute, ={}) unless .has_key?(:path) raise 'Path required' end define_writer attribute define_reader attribute, define_attributes_writer attribute, model.include concern model.[attribute] = end |