Class: Atol::Request::PostDocument::Item::Body
- Inherits:
-
Object
- Object
- Atol::Request::PostDocument::Item::Body
- Defined in:
- lib/atol/request/post_document/item/body.rb
Constant Summary collapse
- BadPaymentMethodError =
Class.new(StandardError)
- BadPaymentObjectError =
Class.new(StandardError)
- PAYMENT_METHODS =
[ 'full_prepayment', 'prepayment', 'advance', 'full_payment', 'partial_payment', 'credit', 'credit_payment' ]
- PAYMENT_OBJECTS =
[ 'commodity', 'excise', 'job', 'service', 'gambling_bet', 'gambling_prize', 'lottery', 'lottery_prize', 'intellectual_activity', 'payment', 'agent_commission', 'composite', 'another' ]
Instance Attribute Summary collapse
-
#agent_info_type ⇒ Object
Returns the value of attribute agent_info_type.
-
#config ⇒ Object
Returns the value of attribute config.
-
#name ⇒ Object
Returns the value of attribute name.
-
#payment_method ⇒ Object
Returns the value of attribute payment_method.
-
#payment_object ⇒ Object
Returns the value of attribute payment_object.
-
#price ⇒ Object
Returns the value of attribute price.
-
#quantity ⇒ Object
Returns the value of attribute quantity.
-
#supplier_info_inn ⇒ Object
Returns the value of attribute supplier_info_inn.
-
#supplier_info_name ⇒ Object
Returns the value of attribute supplier_info_name.
Instance Method Summary collapse
-
#initialize(config: nil, name:, price:, quantity: 1, payment_method:, payment_object:, **options) ⇒ Body
constructor
A new instance of Body.
- #to_h ⇒ Object
- #to_json(*_args) ⇒ Object
Constructor Details
#initialize(config: nil, name:, price:, quantity: 1, payment_method:, payment_object:, **options) ⇒ Body
Returns a new instance of Body.
27 28 29 30 |
# File 'lib/atol/request/post_document/item/body.rb', line 27 def initialize(config: nil, name:, price:, quantity: 1, payment_method:, payment_object:, **) setup_attributes(config, name, price, quantity, payment_method, payment_object, ) validate_attributes end |
Instance Attribute Details
#agent_info_type ⇒ Object
Returns the value of attribute agent_info_type.
24 25 26 |
# File 'lib/atol/request/post_document/item/body.rb', line 24 def agent_info_type @agent_info_type end |
#config ⇒ Object
Returns the value of attribute config.
24 25 26 |
# File 'lib/atol/request/post_document/item/body.rb', line 24 def config @config end |
#name ⇒ Object
Returns the value of attribute name.
24 25 26 |
# File 'lib/atol/request/post_document/item/body.rb', line 24 def name @name end |
#payment_method ⇒ Object
Returns the value of attribute payment_method.
24 25 26 |
# File 'lib/atol/request/post_document/item/body.rb', line 24 def payment_method @payment_method end |
#payment_object ⇒ Object
Returns the value of attribute payment_object.
24 25 26 |
# File 'lib/atol/request/post_document/item/body.rb', line 24 def payment_object @payment_object end |
#price ⇒ Object
Returns the value of attribute price.
24 25 26 |
# File 'lib/atol/request/post_document/item/body.rb', line 24 def price @price end |
#quantity ⇒ Object
Returns the value of attribute quantity.
24 25 26 |
# File 'lib/atol/request/post_document/item/body.rb', line 24 def quantity @quantity end |
#supplier_info_inn ⇒ Object
Returns the value of attribute supplier_info_inn.
24 25 26 |
# File 'lib/atol/request/post_document/item/body.rb', line 24 def supplier_info_inn @supplier_info_inn end |
#supplier_info_name ⇒ Object
Returns the value of attribute supplier_info_name.
24 25 26 |
# File 'lib/atol/request/post_document/item/body.rb', line 24 def supplier_info_name @supplier_info_name end |
Instance Method Details
#to_h ⇒ Object
32 33 34 |
# File 'lib/atol/request/post_document/item/body.rb', line 32 def to_h body.clone end |
#to_json(*_args) ⇒ Object
36 37 38 |
# File 'lib/atol/request/post_document/item/body.rb', line 36 def to_json(*_args) body.to_json end |