Sha256: 4205849bedc976eb77b9469c316b2114e6d9d794d2eec46a1a9de19e7ab71344

Contents?: true

Size: 728 Bytes

Versions: 2

Compression:

Stored size: 728 Bytes

Contents

require 'metric/configuration'
require 'metric/track'
require 'metric/receive'
require 'cgi'

module Metric
  class << self
    # Holds the configuration for easy access to settings
    attr_accessor :configuration

    # Configures gem options
    #
    # @param [Block]
    def configure
      self.configuration ||= Metric::Configuration.new
      yield(configuration)
    end

    # Tracks metrics
    #
    # @param [String, Hash]
    # @return [nil]
    def track(metric, options = {})
      Metric::Track.track(metric, options)
    end

    # Fetches data from the API
    #
    # @param [String, String]
    # @return [Hash]
    def receive(metric, range)
      Metric::Receive.receive(metric, range)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
metric-0.0.7 lib/metric.rb
metric-0.0.6 lib/metric.rb