Module: Freee

Defined in:
lib/freee.rb,
lib/freee/tag.rb,
lib/freee/tax.rb,
lib/freee/base.rb,
lib/freee/deal.rb,
lib/freee/item.rb,
lib/freee/user.rb,
lib/freee/util.rb,
lib/freee/company.rb,
lib/freee/partner.rb,
lib/freee/section.rb,
lib/freee/version.rb,
lib/freee/transfer.rb,
lib/freee/wallet_txn.rb,
lib/freee/walletable.rb,
lib/freee/account_item.rb

Defined Under Namespace

Modules: Response, Util Classes: AccountItem, Base, Company, Deal, Item, Partner, Section, Tag, Tax, Transfer, User, WalletTxn, Walletable

Constant Summary collapse

OPTIONS =
{
  site: 'https://api.freee.co.jp',
  authorize_url: '/oauth/authorize',
  token_url: '/oauth/token'
}
VERSION =
"1.0.0"

Class Method Summary collapse

Class Method Details

.clientObject



5
6
7
# File 'lib/freee/base.rb', line 5

def client
  Base.new.client
end

.encode_json(params) ⇒ Object



19
20
21
22
23
# File 'lib/freee/base.rb', line 19

def encode_json(params)
  JSON.parse(params).to_json
rescue
  '?' + URI.encode_www_form(JSON.parse(params, quirks_mode: true))
end

.encode_params(kwargs) ⇒ Object



10
11
12
13
14
15
16
# File 'lib/freee/base.rb', line 10

def encode_params(kwargs)
  if kwargs.length != 0
    '&' + URI.encode_www_form(kwargs)
  else
    ''
  end
end

.includes(file_path, search_path) ⇒ Object



26
27
28
29
30
# File 'lib/freee/base.rb', line 26

def includes(file_path, search_path)
  Dir.glob(File.realpath(File.dirname(file_path)) + '/' + search_path).map do |f|
    require f if FileTest.file?(f)
  end
end