Class: AmazonDrs::Replenish

Inherits:
Base
  • Object
show all
Defined in:
lib/amazon-drs/replenish.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#date, #error_description_url, #error_type, #request_id, #status_code

Instance Method Summary collapse

Methods inherited from Base

#initialize, #inspect

Constructor Details

This class inherits a constructor from AmazonDrs::Base

Instance Attribute Details

#detail_codeObject

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_idObject

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

#messageObject

Returns the value of attribute message.



5
6
7
# File 'lib/amazon-drs/replenish.rb', line 5

def message
  @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