Class: Magento::PolymorphicModel
- Inherits:
-
Object
- Object
- Magento::PolymorphicModel
- Defined in:
- lib/magento/polymorphic_model.rb
Instance Attribute Summary collapse
-
#api_resource ⇒ Object
readonly
Returns the value of attribute api_resource.
Instance Method Summary collapse
- #build(attributes) ⇒ Object
-
#initialize(model, api_resource) ⇒ PolymorphicModel
constructor
A new instance of PolymorphicModel.
- #new ⇒ Object
Constructor Details
#initialize(model, api_resource) ⇒ PolymorphicModel
Returns a new instance of PolymorphicModel.
5 6 7 8 |
# File 'lib/magento/polymorphic_model.rb', line 5 def initialize(model, api_resource) @model = model @api_resource = api_resource end |
Instance Attribute Details
#api_resource ⇒ Object (readonly)
Returns the value of attribute api_resource.
3 4 5 |
# File 'lib/magento/polymorphic_model.rb', line 3 def api_resource @api_resource end |
Instance Method Details
#build(attributes) ⇒ Object
14 15 16 |
# File 'lib/magento/polymorphic_model.rb', line 14 def build(attributes) @model.build(attributes) end |
#new ⇒ Object
10 11 12 |
# File 'lib/magento/polymorphic_model.rb', line 10 def new @model.new end |