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.
20 21 22 |
# File 'lib/active_resource/associations/builder/association.rb', line 20 def initialize(model, name, ) @model, @name, @options = model, name, end |
Instance Attribute Details
#klass ⇒ Object (readonly)
Returns the value of attribute klass.
14 15 16 |
# File 'lib/active_resource/associations/builder/association.rb', line 14 def klass @klass end |
#model ⇒ Object (readonly)
Returns the value of attribute model.
14 15 16 |
# File 'lib/active_resource/associations/builder/association.rb', line 14 def model @model end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
14 15 16 |
# File 'lib/active_resource/associations/builder/association.rb', line 14 def name @name end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
14 15 16 |
# File 'lib/active_resource/associations/builder/association.rb', line 14 def @options end |
Class Method Details
.build(model, name, options) ⇒ Object
16 17 18 |
# File 'lib/active_resource/associations/builder/association.rb', line 16 def self.build(model, name, ) new(model, name, ).build end |
Instance Method Details
#build ⇒ Object
24 25 26 27 |
# File 'lib/active_resource/associations/builder/association.rb', line 24 def build reflection = model.create_reflection(self.class.macro, name, ) end |