Class: RubyOmx::OrderInfoRequest
- Defined in:
- lib/ruby_omx/request/order_info_request.rb
Instance Attribute Summary collapse
-
#order_id ⇒ Object
Returns the value of attribute order_id.
-
#order_number ⇒ Object
Returns the value of attribute order_number.
-
#store_code ⇒ Object
Returns the value of attribute store_code.
Attributes inherited from Request
Instance Method Summary collapse
-
#initialize(attrs = {}) ⇒ OrderInfoRequest
constructor
A new instance of OrderInfoRequest.
Methods inherited from Response
Methods inherited from Node
Constructor Details
#initialize(attrs = {}) ⇒ OrderInfoRequest
Returns a new instance of OrderInfoRequest.
5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/ruby_omx/request/order_info_request.rb', line 5 def initialize(attrs={}) return super unless attrs.any? # Require either an order number or a store code and an order id to locate the order raise MissingRequestOptions if attrs[:order_number].nil? && (attrs[:store_code].nil? || attrs[:order_id].nil?) super self.version = attrs[:version] ||= '1.00' self.udi_parameters << RubyOmx::UDIParameter.new({:key=>'OrderNumber', :value=>attrs[:order_number]}) if attrs[:order_number] self.udi_parameters << RubyOmx::UDIParameter.new({:key=>'OrderID', :value=>attrs[:order_id]}) if attrs[:order_id] self.udi_parameters << RubyOmx::UDIParameter.new({:key=>'StoreCode', :value=>attrs[:store_code]}) if attrs[:store_code] self.udi_parameters << RubyOmx::UDIParameter.new({:key=>'level', :value=>attrs[:level] ||=2 }) end |
Instance Attribute Details
#order_id ⇒ Object
Returns the value of attribute order_id.
18 19 20 |
# File 'lib/ruby_omx/request/order_info_request.rb', line 18 def order_id @order_id end |
#order_number ⇒ Object
Returns the value of attribute order_number.
18 19 20 |
# File 'lib/ruby_omx/request/order_info_request.rb', line 18 def order_number @order_number end |
#store_code ⇒ Object
Returns the value of attribute store_code.
18 19 20 |
# File 'lib/ruby_omx/request/order_info_request.rb', line 18 def store_code @store_code end |