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