Module: Mitake

Defined in:
lib/mitake.rb,
lib/mitake/api.rb,
lib/mitake/model.rb,
lib/mitake/parser.rb,
lib/mitake/status.rb,
lib/mitake/api/get.rb,
lib/mitake/balance.rb,
lib/mitake/boolean.rb,
lib/mitake/message.rb,
lib/mitake/version.rb,
lib/mitake/api/base.rb,
lib/mitake/api/post.rb,
lib/mitake/response.rb,
lib/mitake/recipient.rb,
lib/mitake/credential.rb,
lib/mitake/status_code.rb,
lib/mitake/model/accessor.rb,
lib/mitake/model/attributes.rb

Overview

The Mitake API Client

Since:

  • 0.1.0

Defined Under Namespace

Modules: API, Model, Status Classes: Balance, Boolean, Credential, Message, Parser, Recipient, Response, StatusCode

Constant Summary collapse

LOCK =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

Since:

  • 0.1.0

Mutex.new
VERSION =

Since:

  • 0.1.0

'0.1.2'

Class Method Summary collapse

Class Method Details

.credentialMitake::Credential

The credential

Since:

  • 0.1.0



36
37
38
# File 'lib/mitake.rb', line 36

def self.credential
  @credential ||= Credential.new
end

.credential=(credential) ⇒ Object

Set credential

Since:

  • 0.1.0



45
46
47
# File 'lib/mitake.rb', line 45

def self.credential=(credential)
  @credential = credential
end

.use(credential, &_block) ⇒ Object

Switch credential

Since:

  • 0.1.0



22
23
24
25
26
27
28
29
# File 'lib/mitake.rb', line 22

def self.use(credential, &_block)
  temp = credential
  LOCK.synchronize do
    self.credential = credential
    yield
    self.credential = temp
  end
end