module Kiik

Constants

VERSION

Attributes

config_path[RW]

Public Class Methods

config() click to toggle source
# File lib/kiik-api.rb, line 30
def self.config
  @config ||= load_config
end
load_config() click to toggle source
# File lib/kiik-api.rb, line 39
def self.load_config

  if @config_path.nil?
    if defined?(Rails)
      @config_path = Rails.root.join('config','kiik.yml')
    else
      @config_path = 'kiik.yml'
    end
  end

  unless File.file?(config_path)
    raise NotConfigured.new("The #{config_path} config file is missing.")
  end

  cfg = YAML.load_file(config_path)
  raise NoAuthorizationTokenProvided.new("You will need a authorization token to perform request on kiik api") if cfg[:token].nil?
  cfg
end
wallet() click to toggle source
# File lib/kiik-api.rb, line 34
def self.wallet
  @wallet ||= Kiik::Wallet.new(config[:token],config[:wallet])
  @wallet.api
end