Class: Io::Flow::V0::Models::ShipmentWindow

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ ShipmentWindow

Returns a new instance of ShipmentWindow.



65846
65847
65848
65849
65850
65851
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 65846

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:from, :to], 'ShipmentWindow')
  @from = HttpClient::Preconditions.assert_class('from', opts.delete(:from), Integer)
  @to = HttpClient::Preconditions.assert_class('to', opts.delete(:to), Integer)
end

Instance Attribute Details

#fromObject (readonly)

Returns the value of attribute from.



65844
65845
65846
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 65844

def from
  @from
end

#toObject (readonly)

Returns the value of attribute to.



65844
65845
65846
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 65844

def to
  @to
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



65857
65858
65859
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 65857

def copy(incoming={})
  ShipmentWindow.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
end

#to_hashObject



65861
65862
65863
65864
65865
65866
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 65861

def to_hash
  {
    :from => from,
    :to => to
  }
end

#to_jsonObject



65853
65854
65855
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 65853

def to_json
  JSON.dump(to_hash)
end