Class: Vend::Resource::RegisterSaleProduct

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#attrsObject (readonly)

Returns the value of attribute attrs.



6
7
8
# File 'lib/vend/resource/register_sale_product.rb', line 6

def attrs
  @attrs
end