Class: Io::Flow::V0::Models::ProcessingEstimate
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::ProcessingEstimate
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#location ⇒ Object
readonly
Returns the value of attribute location.
-
#max_date ⇒ Object
readonly
Returns the value of attribute max_date.
-
#min_date ⇒ Object
readonly
Returns the value of attribute min_date.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ ProcessingEstimate
constructor
A new instance of ProcessingEstimate.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ ProcessingEstimate
Returns a new instance of ProcessingEstimate.
33308 33309 33310 33311 33312 33313 33314 33315 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33308 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:location, :min_date, :max_date, :source], 'ProcessingEstimate') @location = (x = opts.delete(:location); x.is_a?(::Io::Flow::V0::Models::DeliveryWindowLocation) ? x : ::Io::Flow::V0::Models::DeliveryWindowLocation.apply(x)) @min_date = HttpClient::Preconditions.assert_class('min_date', HttpClient::Helper.to_date_time_iso8601(opts.delete(:min_date)), DateTime) @max_date = HttpClient::Preconditions.assert_class('max_date', HttpClient::Helper.to_date_time_iso8601(opts.delete(:max_date)), DateTime) @source = (x = opts.delete(:source); x.is_a?(::Io::Flow::V0::Models::DeliveryWindowComponentSource) ? x : ::Io::Flow::V0::Models::DeliveryWindowComponentSource.apply(x)) end |
Instance Attribute Details
#location ⇒ Object (readonly)
Returns the value of attribute location.
33306 33307 33308 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33306 def location @location end |
#max_date ⇒ Object (readonly)
Returns the value of attribute max_date.
33306 33307 33308 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33306 def max_date @max_date end |
#min_date ⇒ Object (readonly)
Returns the value of attribute min_date.
33306 33307 33308 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33306 def min_date @min_date end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
33306 33307 33308 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33306 def source @source end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
33321 33322 33323 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33321 def copy(incoming={}) ProcessingEstimate.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
33325 33326 33327 33328 33329 33330 33331 33332 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33325 def to_hash { :location => location.value, :min_date => min_date, :max_date => max_date, :source => source.value } end |
#to_json ⇒ Object
33317 33318 33319 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33317 def to_json JSON.dump(to_hash) end |