Class: Io::Flow::V0::Models::TokenVersion
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::TokenVersion
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
-
#token ⇒ Object
readonly
Returns the value of attribute token.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ TokenVersion
constructor
A new instance of TokenVersion.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ TokenVersion
Returns a new instance of TokenVersion.
16395 16396 16397 16398 16399 16400 16401 16402 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16395 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:id, :timestamp, :type, :token], 'TokenVersion') @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String) = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime) @type = (x = opts.delete(:type); x.is_a?(::Io::Flow::V0::Models::ChangeType) ? x : ::Io::Flow::V0::Models::ChangeType.apply(x)) @token = (x = opts.delete(:token); x.is_a?(::Io::Flow::V0::Models::Token) ? x : ::Io::Flow::V0::Models::Token.new(x)) end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
16393 16394 16395 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16393 def id @id end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
16393 16394 16395 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16393 def end |
#token ⇒ Object (readonly)
Returns the value of attribute token.
16393 16394 16395 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16393 def token @token end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
16393 16394 16395 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16393 def type @type end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
16408 16409 16410 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16408 def copy(incoming={}) TokenVersion.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
16412 16413 16414 16415 16416 16417 16418 16419 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16412 def to_hash { :id => id, :timestamp => , :type => type.value, :token => token.to_hash } end |
#to_json ⇒ Object
16404 16405 16406 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16404 def to_json JSON.dump(to_hash) end |