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 www.iana.org/time-zones

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ Timezone

Returns a new instance of Timezone.



52672
52673
52674
52675
52676
52677
52678
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52672

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

#descriptionObject (readonly)

Returns the value of attribute description.



52670
52671
52672
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52670

def description
  @description
end

#nameObject (readonly)

Returns the value of attribute name.



52670
52671
52672
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52670

def name
  @name
end

#offsetObject (readonly)

Returns the value of attribute offset.



52670
52671
52672
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52670

def offset
  @offset
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



52684
52685
52686
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52684

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

#to_hashObject



52688
52689
52690
52691
52692
52693
52694
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52688

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

#to_jsonObject



52680
52681
52682
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52680

def to_json
  JSON.dump(to_hash)
end