class Moip2::AccountsApi

Attributes

client[R]

Public Class Methods

new(client) click to toggle source
# File lib/moip2/accounts_api.rb, line 5
def initialize(client)
  @client = client
end

Public Instance Methods

base_path() click to toggle source
# File lib/moip2/accounts_api.rb, line 9
def base_path
  "/v2/accounts"
end
create(account) click to toggle source
# File lib/moip2/accounts_api.rb, line 13
def create(account)
  Resource::Account.new client, client.post(base_path, account)
end
exists?(data) click to toggle source
# File lib/moip2/accounts_api.rb, line 17
def exists?(data)
  raise "Use: {email: 'dev@moip.com'} or {tax_document: '999.999.999-99'}" unless has_attribute_to_search(data)

  response = client.get("#{base_path}/exists?#{to_search(data)}")

  response.success?
end
show(id) click to toggle source
# File lib/moip2/accounts_api.rb, line 25
def show(id)
  Resource::Account.new client, client.get("#{base_path}/#{id}")
end

Private Instance Methods