Class: Metric::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/metric/configuration.rb

Overview

Used for configuration of the Metric gem. The only required option is api_key, secret_key is only used if you want to pull data out from the API and host is used for local debugging purposes.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize ⇒ Configuration

Sets defaults



21
22
23
24
# File 'lib/metric/configuration.rb', line 21

def initialize
  @host = "api.metric.io"
  @ssl = true
end

Instance Attribute Details

#api_key ⇒ Object

Key used to identify the website



9
10
11
# File 'lib/metric/configuration.rb', line 9

def api_key
  @api_key
end

#host ⇒ Object

Allows setting a different host to send data to, used for development purposes



12
13
14
# File 'lib/metric/configuration.rb', line 12

def host
  @host
end

#secret_key ⇒ Object

Used to generate a hash for getting data out



15
16
17
# File 'lib/metric/configuration.rb', line 15

def secret_key
  @secret_key
end

#ssl ⇒ Object

Setting SSL on or off



18
19
20
# File 'lib/metric/configuration.rb', line 18

def ssl
  @ssl
end

Instance Method Details

#protocol ⇒ Object

Protocol to use



27
28
29
# File 'lib/metric/configuration.rb', line 27

def protocol
  @ssl ? "https" : "http"
end