Sha256: 3abf167d3de7d16b527eca9ae7fe14ecc3aa8adafed9be04b541cfb2ff0f9634

Contents?: true

Size: 755 Bytes

Versions: 1

Compression:

Stored size: 755 Bytes

Contents

class Remnant
  class Configuration
    # environment of application
    attr_reader :env

    # hostname to send to
    attr_reader :hostname

    # port to send to
    attr_reader :port_number

    # api key to use with payloads
    attr_reader :tag

    attr_reader :sample_rate

    def host(value)
      @hostname = value
    end

    def port(value)
      @port_number = value
    end

    def tagged(value)
      @tag = value
    end

    def environment(value)
      @env = value
    end

    def sample(value)
      @sample_rate = value
    end

    def defaults!
      # configure some defaults

      @hostname = '127.0.0.1'
      @port_number = 8125
      @tag = 'remnant'
      @sample_rate = 10

      self
    end # end defaults!
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
remnant-0.2.2 lib/remnant/configuration.rb