Class: AmazonDrs::Replenish
Instance Attribute Summary collapse
-
#detail_code ⇒ Object
Returns the value of attribute detail_code.
-
#event_instance_id ⇒ Object
Returns the value of attribute event_instance_id.
-
#message ⇒ Object
Returns the value of attribute message.
Attributes inherited from Base
#date, #error_description_url, #error_type, #request_id, #status_code
Instance Method Summary collapse
Methods inherited from Base
Constructor Details
This class inherits a constructor from AmazonDrs::Base
Instance Attribute Details
#detail_code ⇒ Object
Returns the value of attribute detail_code.
5 6 7 |
# File 'lib/amazon-drs/replenish.rb', line 5 def detail_code @detail_code end |
#event_instance_id ⇒ Object
Returns the value of attribute event_instance_id.
5 6 7 |
# File 'lib/amazon-drs/replenish.rb', line 5 def event_instance_id @event_instance_id end |
#message ⇒ Object
Returns the value of attribute message.
5 6 7 |
# File 'lib/amazon-drs/replenish.rb', line 5 def @message end |
Instance Method Details
#parse_body(body) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/amazon-drs/replenish.rb', line 7 def parse_body(body) json = JSON.parse(body) @event_instance_id = json['eventInstanceId'] if json['eventInstanceId'] if json['detailCode'] # STANDARD_ORDER_PLACED, TEST_ORDER_PLACED or ORDER_INPROGRESS @detail_code = json['detailCode'] else @detail_code = 'ERROR' end @message = json['message'] if json['message'] end |