Class: Io::Flow::V0::Models::RatecardEstimateFormV1
- Inherits:
-
RatecardEstimateForm
- Object
- RatecardEstimateForm
- Io::Flow::V0::Models::RatecardEstimateFormV1
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#delivered_duty ⇒ Object
readonly
Returns the value of attribute delivered_duty.
-
#depth ⇒ Object
readonly
Returns the value of attribute depth.
-
#destination ⇒ Object
readonly
Returns the value of attribute destination.
-
#distance_unit ⇒ Object
readonly
Returns the value of attribute distance_unit.
-
#length ⇒ Object
readonly
Returns the value of attribute length.
-
#line_items ⇒ Object
readonly
Returns the value of attribute line_items.
-
#origin ⇒ Object
readonly
Returns the value of attribute origin.
-
#service ⇒ Object
readonly
Returns the value of attribute service.
-
#weight ⇒ Object
readonly
Returns the value of attribute weight.
-
#weight_unit ⇒ Object
readonly
Returns the value of attribute weight_unit.
-
#width ⇒ Object
readonly
Returns the value of attribute width.
Attributes inherited from RatecardEstimateForm
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ RatecardEstimateFormV1
constructor
A new instance of RatecardEstimateFormV1.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from RatecardEstimateForm
Constructor Details
#initialize(incoming = {}) ⇒ RatecardEstimateFormV1
Returns a new instance of RatecardEstimateFormV1.
41017 41018 41019 41020 41021 41022 41023 41024 41025 41026 41027 41028 41029 41030 41031 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41017 def initialize(incoming={}) super(:discriminator => RatecardEstimateForm::Types::RATECARD_ESTIMATE_FORM_V1) opts = HttpClient::Helper.symbolize_keys(incoming) @origin = (x = opts.delete(:origin); x.nil? ? nil : HttpClient::Preconditions.assert_class('origin', x, String)) @destination = (x = opts.delete(:destination); x.nil? ? nil : HttpClient::Preconditions.assert_class('destination', x, String)) @weight_unit = (x = opts.delete(:weight_unit); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::UnitOfMeasurement) ? x : ::Io::Flow::V0::Models::UnitOfMeasurement.apply(x))) @distance_unit = (x = opts.delete(:distance_unit); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::UnitOfMeasurement) ? x : ::Io::Flow::V0::Models::UnitOfMeasurement.apply(x))) @service = (x = opts.delete(:service); x.nil? ? nil : HttpClient::Preconditions.assert_class('service', x, String)) @weight = (x = opts.delete(:weight); x.nil? ? nil : HttpClient::Preconditions.assert_class('weight', x, Numeric)) @length = (x = opts.delete(:length); x.nil? ? nil : HttpClient::Preconditions.assert_class('length', x, Numeric)) @width = (x = opts.delete(:width); x.nil? ? nil : HttpClient::Preconditions.assert_class('width', x, Numeric)) @depth = (x = opts.delete(:depth); x.nil? ? nil : HttpClient::Preconditions.assert_class('depth', x, Numeric)) @delivered_duty = (x = opts.delete(:delivered_duty); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::DeliveredDuty) ? x : ::Io::Flow::V0::Models::DeliveredDuty.apply(x))) @line_items = (x = opts.delete(:line_items); x.nil? ? nil : HttpClient::Preconditions.assert_class('line_items', x, Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::LineItemForm) ? x : ::Io::Flow::V0::Models::LineItemForm.new(x)) }) end |
Instance Attribute Details
#delivered_duty ⇒ Object (readonly)
Returns the value of attribute delivered_duty.
41015 41016 41017 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41015 def delivered_duty @delivered_duty end |
#depth ⇒ Object (readonly)
Returns the value of attribute depth.
41015 41016 41017 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41015 def depth @depth end |
#destination ⇒ Object (readonly)
Returns the value of attribute destination.
41015 41016 41017 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41015 def destination @destination end |
#distance_unit ⇒ Object (readonly)
Returns the value of attribute distance_unit.
41015 41016 41017 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41015 def distance_unit @distance_unit end |
#length ⇒ Object (readonly)
Returns the value of attribute length.
41015 41016 41017 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41015 def length @length end |
#line_items ⇒ Object (readonly)
Returns the value of attribute line_items.
41015 41016 41017 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41015 def line_items @line_items end |
#origin ⇒ Object (readonly)
Returns the value of attribute origin.
41015 41016 41017 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41015 def origin @origin end |
#service ⇒ Object (readonly)
Returns the value of attribute service.
41015 41016 41017 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41015 def service @service end |
#weight ⇒ Object (readonly)
Returns the value of attribute weight.
41015 41016 41017 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41015 def weight @weight end |
#weight_unit ⇒ Object (readonly)
Returns the value of attribute weight_unit.
41015 41016 41017 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41015 def weight_unit @weight_unit end |
#width ⇒ Object (readonly)
Returns the value of attribute width.
41015 41016 41017 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41015 def width @width end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
41037 41038 41039 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41037 def copy(incoming={}) RatecardEstimateFormV1.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
41041 41042 41043 41044 41045 41046 41047 41048 41049 41050 41051 41052 41053 41054 41055 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41041 def subtype_to_hash { :origin => origin, :destination => destination, :weight_unit => weight_unit.nil? ? nil : weight_unit.value, :distance_unit => distance_unit.nil? ? nil : distance_unit.value, :service => service, :weight => weight, :length => length, :width => width, :depth => depth, :delivered_duty => delivered_duty.nil? ? nil : delivered_duty.value, :line_items => line_items.nil? ? nil : line_items.map { |o| o.to_hash } } end |
#to_json ⇒ Object
41033 41034 41035 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41033 def to_json JSON.dump(to_hash) end |