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.
43723 43724 43725 43726 43727 43728 43729 43730 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43723 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.
43721 43722 43723 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43721 def location @location end |
#max_date ⇒ Object (readonly)
Returns the value of attribute max_date.
43721 43722 43723 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43721 def max_date @max_date end |
#min_date ⇒ Object (readonly)
Returns the value of attribute min_date.
43721 43722 43723 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43721 def min_date @min_date end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
43721 43722 43723 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43721 def source @source end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
43736 43737 43738 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43736 def copy(incoming={}) ProcessingEstimate.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
43740 43741 43742 43743 43744 43745 43746 43747 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43740 def to_hash { :location => location.value, :min_date => min_date, :max_date => max_date, :source => source.value } end |
#to_json ⇒ Object
43732 43733 43734 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43732 def to_json JSON.dump(to_hash) end |