Class: ActiveResource::Associations::Builder::Association
- Inherits:
-
Object
- Object
- ActiveResource::Associations::Builder::Association
- Defined in:
- lib/active_resource/associations/builder/association.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#klass ⇒ Object
readonly
Returns the value of attribute klass.
-
#model ⇒ Object
readonly
Returns the value of attribute model.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Class Method Summary collapse
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize(model, name, options) ⇒ Association
constructor
A new instance of Association.
Constructor Details
#initialize(model, name, options) ⇒ Association
Returns a new instance of Association.
18 19 20 |
# File 'lib/active_resource/associations/builder/association.rb', line 18 def initialize(model, name, ) @model, @name, @options = model, name, end |
Instance Attribute Details
#klass ⇒ Object (readonly)
Returns the value of attribute klass.
12 13 14 |
# File 'lib/active_resource/associations/builder/association.rb', line 12 def klass @klass end |
#model ⇒ Object (readonly)
Returns the value of attribute model.
12 13 14 |
# File 'lib/active_resource/associations/builder/association.rb', line 12 def model @model end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
12 13 14 |
# File 'lib/active_resource/associations/builder/association.rb', line 12 def name @name end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
12 13 14 |
# File 'lib/active_resource/associations/builder/association.rb', line 12 def @options end |
Class Method Details
.build(model, name, options) ⇒ Object
14 15 16 |
# File 'lib/active_resource/associations/builder/association.rb', line 14 def self.build(model, name, ) new(model, name, ).build end |
Instance Method Details
#build ⇒ Object
22 23 24 25 |
# File 'lib/active_resource/associations/builder/association.rb', line 22 def build model.create_reflection(self.class.macro, name, ) end |