class Io::Flow::V0::Models::DatetimeRange

Attributes

from[R]
to[R]

Public Class Methods

new(incoming={}) click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 38773
def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:from, :to], 'DatetimeRange')
  @from = HttpClient::Preconditions.assert_class('from', HttpClient::Helper.to_date_time_iso8601(opts.delete(:from)), DateTime)
  @to = HttpClient::Preconditions.assert_class('to', HttpClient::Helper.to_date_time_iso8601(opts.delete(:to)), DateTime)
end

Public Instance Methods

copy(incoming={}) click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 38784
def copy(incoming={})
  DatetimeRange.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
end
to_hash() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 38788
def to_hash
  {
    :from => from,
    :to => to
  }
end
to_json() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 38780
def to_json
  JSON.dump(to_hash)
end