Class: Io::Flow::V0::Models::SessionAuthorizationForm

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

Overview

Authorize a request using a session id

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ SessionAuthorizationForm

Returns a new instance of SessionAuthorizationForm.



65262
65263
65264
65265
65266
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 65262

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:session], 'SessionAuthorizationForm')
  @session = HttpClient::Preconditions.assert_class('session', opts.delete(:session), String)
end

Instance Attribute Details

#sessionObject (readonly)

Returns the value of attribute session.



65260
65261
65262
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 65260

def session
  @session
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



65272
65273
65274
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 65272

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

#to_hashObject



65276
65277
65278
65279
65280
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 65276

def to_hash
  {
    :session => session
  }
end

#to_jsonObject



65268
65269
65270
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 65268

def to_json
  JSON.dump(to_hash)
end