Class: Atol::Request::PostDocument::Item::V4::Body

Inherits:
Object
  • Object
show all
Defined in:
lib/atol/request/post_document/item/v4/body.rb

Constant Summary collapse

BadPaymentMethodError =
Class.new(StandardError)
BadPaymentObjectError =
Class.new(StandardError)
PAYMENT_METHODS =
%w[
  full_prepayment prepayment advance full_payment
  partial_payment credit credit_payment
].freeze
PAYMENT_OBJECTS =
%w[
  commodity excise job service gambling_bet gambling_prize
  lottery lottery_prize intellectual_activity payment agent_commission
  composite another
].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config: nil, name:, price:, quantity: 1, payment_method:, payment_object:, **options) ⇒ Body

Returns a new instance of Body.



35
36
37
38
# File 'lib/atol/request/post_document/item/v4/body.rb', line 35

def initialize(config: nil, name:, price:, quantity: 1, payment_method:, payment_object:, **options)
  setup_attributes(config, name, price, quantity, payment_method, payment_object, options)
  validate_attributes
end

Instance Attribute Details

#agent_info_typeObject

Returns the value of attribute agent_info_type.



25
26
27
# File 'lib/atol/request/post_document/item/v4/body.rb', line 25

def agent_info_type
  @agent_info_type
end

#configObject

Returns the value of attribute config.



25
26
27
# File 'lib/atol/request/post_document/item/v4/body.rb', line 25

def config
  @config
end

#nameObject

Returns the value of attribute name.



25
26
27
# File 'lib/atol/request/post_document/item/v4/body.rb', line 25

def name
  @name
end

#payment_methodObject

Returns the value of attribute payment_method.



25
26
27
# File 'lib/atol/request/post_document/item/v4/body.rb', line 25

def payment_method
  @payment_method
end

#payment_objectObject

Returns the value of attribute payment_object.



25
26
27
# File 'lib/atol/request/post_document/item/v4/body.rb', line 25

def payment_object
  @payment_object
end

#priceObject

Returns the value of attribute price.



25
26
27
# File 'lib/atol/request/post_document/item/v4/body.rb', line 25

def price
  @price
end

#quantityObject

Returns the value of attribute quantity.



25
26
27
# File 'lib/atol/request/post_document/item/v4/body.rb', line 25

def quantity
  @quantity
end

#supplier_info_innObject

Returns the value of attribute supplier_info_inn.



25
26
27
# File 'lib/atol/request/post_document/item/v4/body.rb', line 25

def supplier_info_inn
  @supplier_info_inn
end

#supplier_info_nameObject

Returns the value of attribute supplier_info_name.



25
26
27
# File 'lib/atol/request/post_document/item/v4/body.rb', line 25

def supplier_info_name
  @supplier_info_name
end

Instance Method Details

#to_hObject



40
41
42
# File 'lib/atol/request/post_document/item/v4/body.rb', line 40

def to_h
  body.clone
end

#to_json(*_args) ⇒ Object



44
45
46
# File 'lib/atol/request/post_document/item/v4/body.rb', line 44

def to_json(*_args)
  body.to_json
end