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



48607
48608
48609
48610
48611
48612
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48607

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.



48605
48606
48607
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48605

def from
  @from
end

#toObject (readonly)

Returns the value of attribute to.



48605
48606
48607
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48605

def to
  @to
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



48618
48619
48620
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48618

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

#to_hashObject



48622
48623
48624
48625
48626
48627
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48622

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

#to_jsonObject



48614
48615
48616
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48614

def to_json
  JSON.dump(to_hash)
end