Class: Bigbank::Client::Application

Inherits:
Endpoint
  • Object
show all
Defined in:
lib/bigbank/client/endpoints/application.rb

Defined Under Namespace

Classes: ApplicationResult

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Endpoint

#config, #connection, #user_agent

Constructor Details

#initialize(post_params = {}) ⇒ Application

Returns a new instance of Application.



10
11
12
# File 'lib/bigbank/client/endpoints/application.rb', line 10

def initialize(post_params={})
  @post_params = post_params
end

Instance Attribute Details

#post_paramsObject

Returns the value of attribute post_params.



4
5
6
# File 'lib/bigbank/client/endpoints/application.rb', line 4

def post_params
  @post_params
end

Class Method Details

.create(*args) ⇒ Object



6
7
8
# File 'lib/bigbank/client/endpoints/application.rb', line 6

def self.create(*args)
  self.new(*args).create
end

Instance Method Details

#createObject



14
15
16
17
18
19
20
21
22
# File 'lib/bigbank/client/endpoints/application.rb', line 14

def create
  response = connection.post do |request|
    request.url "/api/"
    request.params = { post: "data" }
    request.body = { key: config.partner_key }.merge!(post_params)
  end

  ApplicationResult.new(response, connection)
end