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.



58443
58444
58445
58446
58447
58448
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 58443

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.



58441
58442
58443
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 58441

def from
  @from
end

#toObject (readonly)

Returns the value of attribute to.



58441
58442
58443
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 58441

def to
  @to
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



58454
58455
58456
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 58454

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

#to_hashObject



58458
58459
58460
58461
58462
58463
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 58458

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

#to_jsonObject



58450
58451
58452
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 58450

def to_json
  JSON.dump(to_hash)
end