Class: RestfulMetrics::Connection

Inherits:
Object
  • Object
show all
Includes:
LogTools
Defined in:
lib/restful_metrics/connection.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from LogTools

#logger

Constructor Details

#initialize(api_key) ⇒ Connection

Returns a new instance of Connection.



10
11
12
13
14
15
# File 'lib/restful_metrics/connection.rb', line 10

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

Instance Attribute Details

#api_keyObject (readonly)

Returns the value of attribute api_key.



8
9
10
# File 'lib/restful_metrics/connection.rb', line 8

def api_key
  @api_key
end

#asyncObject

Returns the value of attribute async.



7
8
9
# File 'lib/restful_metrics/connection.rb', line 7

def async
  @async
end

#debugObject

Returns the value of attribute debug.



7
8
9
# File 'lib/restful_metrics/connection.rb', line 7

def debug
  @debug
end

#default_optionsObject (readonly)

Returns the value of attribute default_options.



8
9
10
# File 'lib/restful_metrics/connection.rb', line 8

def default_options
  @default_options
end

Instance Method Details

#post(endpoint, data = nil) ⇒ Object



17
18
19
# File 'lib/restful_metrics/connection.rb', line 17

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