Class: Io::Flow::V0::Models::TokenForm

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

Overview

Used to create a new token for the user authorized by the request. You can only create an API token for your own account.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ TokenForm

Returns a new instance of TokenForm.



14511
14512
14513
14514
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14511

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  @description = (x = opts.delete(:description); x.nil? ? nil : HttpClient::Preconditions.assert_class('description', x, String))
end

Instance Attribute Details

#descriptionObject (readonly)

Returns the value of attribute description.



14509
14510
14511
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14509

def description
  @description
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



14520
14521
14522
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14520

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

#to_hashObject



14524
14525
14526
14527
14528
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14524

def to_hash
  {
    :description => description
  }
end

#to_jsonObject



14516
14517
14518
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14516

def to_json
  JSON.dump(to_hash)
end