Class: Atol::Request::PostDocument::Sell::Body
- Inherits:
-
Object
- Object
- Atol::Request::PostDocument::Sell::Body
- Defined in:
- lib/atol/request/post_document/sell/body.rb
Instance Method Summary collapse
-
#initialize(external_id:, phone: '', email: '', items:, config: nil) ⇒ Body
constructor
A new instance of Body.
- #to_h ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(external_id:, phone: '', email: '', items:, config: nil) ⇒ Body
Returns a new instance of Body.
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/atol/request/post_document/sell/body.rb', line 10 def initialize(external_id:, phone: '', email: '', items:, config: nil) raise(Atol::EmptyClientContactError) if phone.empty? && email.empty? raise(Atol::EmptySellItemsError) if items.empty? @config = config || Atol.config @external_id = external_id @phone = phone @email = email @items = items end |
Instance Method Details
#to_h ⇒ Object
21 22 23 |
# File 'lib/atol/request/post_document/sell/body.rb', line 21 def to_h body.clone end |
#to_json ⇒ Object
25 26 27 |
# File 'lib/atol/request/post_document/sell/body.rb', line 25 def to_json body.to_json end |