module Freee

Constants

OPTIONS
VERSION

Public Class Methods

client() click to toggle source
# File lib/freee/base.rb, line 5
def client
  Base.new.client
end
encode_json(params) click to toggle source
# 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) click to toggle source
# 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) click to toggle source
# 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

Private Instance Methods

client() click to toggle source
# File lib/freee/base.rb, line 5
def client
  Base.new.client
end
encode_json(params) click to toggle source
# 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) click to toggle source
# 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) click to toggle source
# 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