Class: Io::Flow::V0::Models::TokenReference
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::TokenReference
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
Summary data for a given token
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#user ⇒ Object
readonly
Returns the value of attribute user.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ TokenReference
constructor
A new instance of TokenReference.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ TokenReference
Returns a new instance of TokenReference.
16367 16368 16369 16370 16371 16372 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16367 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:id, :user], 'TokenReference') @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String) @user = (x = opts.delete(:user); x.is_a?(::Io::Flow::V0::Models::UserReference) ? x : ::Io::Flow::V0::Models::UserReference.new(x)) end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
16365 16366 16367 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16365 def id @id end |
#user ⇒ Object (readonly)
Returns the value of attribute user.
16365 16366 16367 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16365 def user @user end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
16378 16379 16380 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16378 def copy(incoming={}) TokenReference.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
16382 16383 16384 16385 16386 16387 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16382 def to_hash { :id => id, :user => user.to_hash } end |
#to_json ⇒ Object
16374 16375 16376 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16374 def to_json JSON.dump(to_hash) end |