Class: IngramMicro::StandardResponse
- Inherits:
-
Transmission
- Object
- Transmission
- IngramMicro::StandardResponse
- Defined in:
- lib/ingram_micro/transmissions/standard_response.rb
Constant Summary
Constants inherited from Transmission
Instance Attribute Summary collapse
-
#comments ⇒ Object
Returns the value of attribute comments.
-
#filename ⇒ Object
Returns the value of attribute filename.
-
#response_timestamp ⇒ Object
Returns the value of attribute response_timestamp.
-
#status_code ⇒ Object
Returns the value of attribute status_code.
-
#status_description ⇒ Object
Returns the value of attribute status_description.
Attributes inherited from Transmission
Instance Method Summary collapse
- #add_message_header(builder) ⇒ Object
- #add_message_status(builder) ⇒ Object
-
#initialize(options = {}) ⇒ StandardResponse
constructor
A new instance of StandardResponse.
- #order_builder ⇒ Object
Methods inherited from Transmission
#add_transaction_info, #schema_valid?, #send_request, #submit_request
Constructor Details
#initialize(options = {}) ⇒ StandardResponse
5 6 7 8 9 10 11 12 13 |
# File 'lib/ingram_micro/transmissions/standard_response.rb', line 5 def initialize(={}) super() @transaction_name = 'standard-response' @status_code = [:status_code] @status_description = [:status_description] @comments = [:comments] @response_timestamp = [:response_timestamp] @filename = [:filename] end |
Instance Attribute Details
#comments ⇒ Object
Returns the value of attribute comments.
2 3 4 |
# File 'lib/ingram_micro/transmissions/standard_response.rb', line 2 def comments @comments end |
#filename ⇒ Object
Returns the value of attribute filename.
2 3 4 |
# File 'lib/ingram_micro/transmissions/standard_response.rb', line 2 def filename @filename end |
#response_timestamp ⇒ Object
Returns the value of attribute response_timestamp.
2 3 4 |
# File 'lib/ingram_micro/transmissions/standard_response.rb', line 2 def @response_timestamp end |
#status_code ⇒ Object
Returns the value of attribute status_code.
2 3 4 |
# File 'lib/ingram_micro/transmissions/standard_response.rb', line 2 def status_code @status_code end |
#status_description ⇒ Object
Returns the value of attribute status_description.
2 3 4 |
# File 'lib/ingram_micro/transmissions/standard_response.rb', line 2 def status_description @status_description end |
Instance Method Details
#add_message_header(builder) ⇒ Object
25 26 27 28 29 30 31 32 33 |
# File 'lib/ingram_micro/transmissions/standard_response.rb', line 25 def (builder) = IngramMicro::MessageHeaderPW.new({ partner_name: IngramMicro.configuration.partner_name, transaction_name: transaction_name}) builder.send('message-header') do .build(builder) end .valid? end |
#add_message_status(builder) ⇒ Object
35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/ingram_micro/transmissions/standard_response.rb', line 35 def (builder) = IngramMicro::MessageStatus.new({ status_code: @status_code, status_description: @status_description, comments: @comments, response_timestamp: @response_timestamp, filename: @filename }) builder.send('message-status') do .build(builder) end end |
#order_builder ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'lib/ingram_micro/transmissions/standard_response.rb', line 15 def order_builder @builder ||= Nokogiri::XML::Builder.new do |builder| builder. do (builder) (builder) add_transaction_info(builder) end end end |