Class: Analytico::Connection

Inherits:
Object
  • Object
show all
Defined in:
lib/analytico/connection.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_key) ⇒ Connection

Returns a new instance of Connection.



8
9
10
11
12
13
# File 'lib/analytico/connection.rb', line 8

def initialize(api_key)
  @api_key = api_key
  @default_options = { }
  @debug = false
  @async = false
end

Instance Attribute Details

#api_keyObject (readonly)

Returns the value of attribute api_key.



6
7
8
# File 'lib/analytico/connection.rb', line 6

def api_key
  @api_key
end

#asyncObject

Returns the value of attribute async.



5
6
7
# File 'lib/analytico/connection.rb', line 5

def async
  @async
end

#debugObject

Returns the value of attribute debug.



5
6
7
# File 'lib/analytico/connection.rb', line 5

def debug
  @debug
end

#default_optionsObject (readonly)

Returns the value of attribute default_options.



6
7
8
# File 'lib/analytico/connection.rb', line 6

def default_options
  @default_options
end

Instance Method Details

#post(endpoint, data = nil) ⇒ Object



15
16
17
# File 'lib/analytico/connection.rb', line 15

def post(endpoint, data=nil)
  request :post, endpoint, data
end