Class: Emporium::Product
- Inherits:
-
Object
- Object
- Emporium::Product
- Defined in:
- lib/emporium/product.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
Returns the value of attribute code.
-
#service ⇒ Object
Returns the value of attribute service.
Instance Method Summary collapse
- #fetch! ⇒ Object
-
#initialize(code) ⇒ Product
constructor
A new instance of Product.
Constructor Details
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args) ⇒ Object (private)
28 29 30 31 32 33 34 |
# File 'lib/emporium/product.rb', line 28 def method_missing(name, *args) if self.instance_variables.include? :"@#{name}" self.instance_variable_get("@#{name}") else super end end |
Instance Attribute Details
#code ⇒ Object
Returns the value of attribute code.
3 4 5 |
# File 'lib/emporium/product.rb', line 3 def code @code end |
#service ⇒ Object
Returns the value of attribute service.
4 5 6 |
# File 'lib/emporium/product.rb', line 4 def service @service end |
Instance Method Details
#fetch! ⇒ Object
11 12 13 14 |
# File 'lib/emporium/product.rb', line 11 def fetch! @service.response create @service.response end |