Class: Vend::Resource::RegisterSaleProduct
- Inherits:
-
Object
- Object
- Vend::Resource::RegisterSaleProduct
- Defined in:
- lib/vend/resource/register_sale_product.rb
Overview
Note this class does not have a corresponding endpoint in the vend api It is used to provide a consistent interface to clients using this gem
Instance Attribute Summary collapse
-
#attrs ⇒ Object
readonly
Returns the value of attribute attrs.
Instance Method Summary collapse
-
#initialize(attrs) ⇒ RegisterSaleProduct
constructor
A new instance of RegisterSaleProduct.
- #method_missing(method_name, *_args, &_block) ⇒ Object
Constructor Details
#initialize(attrs) ⇒ RegisterSaleProduct
Returns a new instance of RegisterSaleProduct.
8 9 10 |
# File 'lib/vend/resource/register_sale_product.rb', line 8 def initialize(attrs) @attrs = attrs end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name, *_args, &_block) ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/vend/resource/register_sale_product.rb', line 12 def method_missing(method_name, *_args, &_block) if attrs.keys.include? method_name.to_s attrs[method_name.to_s] else super(method_name) end end |
Instance Attribute Details
#attrs ⇒ Object (readonly)
Returns the value of attribute attrs.
6 7 8 |
# File 'lib/vend/resource/register_sale_product.rb', line 6 def attrs @attrs end |