Class: StartupStats::Countdb::Client

Inherits:
Object
  • Object
show all
Includes:
StartupStats::Configurable, Counts, Requestable
Defined in:
lib/startupstats/countdb/client.rb

Overview

< StartupStats::Client

Instance Attribute Summary collapse

Attributes included from StartupStats::Configurable

#access_token, #access_token_key, #connection_options, #endpoint, #middleware

Instance Method Summary collapse

Methods included from Counts

#counts_for_day, #counts_for_key, #delete_count, #delete_counts, #increment_key, #increment_key_for_date, #update_key

Methods included from Requestable

#delete, #get, #post, #put

Methods included from StartupStats::Configurable

#cache_key, #configure, #credentials?, keys, #reset!

Constructor Details

#initialize(options = {}) ⇒ Client

Returns a new instance of Client.



19
20
21
22
23
24
25
26
27
# File 'lib/startupstats/countdb/client.rb', line 19

def initialize( options = {} )
	# raise StartupStats::Error::ParamsError unless options.has_key?(:db_id) && options[:db_id].match(/^\w+$/)
	@db_id = ( options.has_key?(:db_id) ) ? options[:db_id] : nil
	setup
	@access_token_key = 'token'
	StartupStats::Configurable.keys.each do |key|
		instance_variable_set(:"@#{key}", options[key] || instance_variable_get(:"@#{key}"))
	end
end

Instance Attribute Details

#db_idObject

Returns the value of attribute db_id.



11
12
13
# File 'lib/startupstats/countdb/client.rb', line 11

def db_id
  @db_id
end