Sha256: 160da87984d0d989b71d79b3f5f248ce73b93761e930e18dde30122dcc932477

Contents?: true

Size: 736 Bytes

Versions: 4

Compression:

Stored size: 736 Bytes

Contents

module Metric

  # 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.

  class Configuration
    # Key used to identify the website
    attr_accessor :api_key

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

    # Used to generate a hash for getting data out
    attr_accessor :secret_key

    # Setting SSL on or off
    attr_accessor :ssl

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

    # Protocol to use
    def protocol
      @ssl ? "https" : "http"
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
metric-0.1.2 lib/metric/configuration.rb
metric-0.1.1 lib/metric/configuration.rb
metric-0.1.0 lib/metric/configuration.rb
metric-0.0.9 lib/metric/configuration.rb