Sha256: 1ba73a296829918a72c9623841dd6659cd0034744752377df440eb6b9bc63a19

Contents?: true

Size: 709 Bytes

Versions: 1

Compression:

Stored size: 709 Bytes

Contents

module Outpost
  class ScoutConfig
    attr_reader :options, :reports

    # Reads/writes any options. It will passed
    # down to the scout.
    def options(args=nil)
      if args.nil?
        @options
      else
        @options = args
      end
    end

    # Reads reporting as:
    #   report :up, :response_code => 200
    #
    # It reads much better in the DSL, but doesn't make
    # much sense in terms of code, so it is changed to
    # an inverted approach, so:
    #   status = 200
    #   params = {:response_code => 200}
    #
    #   gets stored as:
    #    {:response_code => 200} = up
    def report(status, params)
      @reports ||= {}
      @reports[params] = status
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
outpost-0.1.0 lib/outpost/scout_config.rb