Class: Io::Flow::V0::Models::Timezone

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

Overview

Time zone data is provided by the public IANA time zone database. See http://www.iana.org/time-zones

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ Timezone

Returns a new instance of Timezone.



21874
21875
21876
21877
21878
21879
21880
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21874

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:name, :description, :offset], 'Timezone')
  @name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
  @description = HttpClient::Preconditions.assert_class('description', opts.delete(:description), String)
  @offset = HttpClient::Preconditions.assert_class('offset', opts.delete(:offset), Integer)
end

Instance Attribute Details

#description ⇒ Object (readonly)

Returns the value of attribute description.



21872
21873
21874
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21872

def description
  @description
end

#name ⇒ Object (readonly)

Returns the value of attribute name.



21872
21873
21874
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21872

def name
  @name
end

#offset ⇒ Object (readonly)

Returns the value of attribute offset.



21872
21873
21874
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21872

def offset
  @offset
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



21886
21887
21888
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21886

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

#to_hash ⇒ Object



21890
21891
21892
21893
21894
21895
21896
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21890

def to_hash
  {
    :name => name,
    :description => description,
    :offset => offset
  }
end

#to_json ⇒ Object



21882
21883
21884
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21882

def to_json
  JSON.dump(to_hash)
end