module Dianping::Api

Constants

VERSION

Public Class Methods

client() { |Client| ... } click to toggle source
# File lib/dianping/api.rb, line 20
def self.client
  return @client = yield(Client) if block_given?

  @client || raise(::Dianping::Api::Error, 'initialize client with block first')
end
logger() click to toggle source
# File lib/dianping/api.rb, line 12
def self.logger
  @logger ||= defined?(Rails) ? Rails.logger : ::Logger.new(STDOUT)
end
logger=(logger) click to toggle source
# File lib/dianping/api.rb, line 16
def self.logger=(logger)
  @logger = logger
end