Sha256: fed55c2730dbdaf8a5c80762e4be6f63c67f8eb913f5a7be195b37e37a23d8b4

Contents?: true

Size: 756 Bytes

Versions: 1

Compression:

Stored size: 756 Bytes

Contents

module FootStats
  # Class responsible to handle all the FootStats setup.
  #
  # @example
  #
  #    FootStats::Setup.setup do |config|
  #      config.username      = "foo"
  #      config.password      = "bar"
  #      config.logger        = Rails.logger
  #      config.base_url      = "http://footstats.com.br/modyo.asmx/"
  #      config.payload_store = Redis.new
  #    end
  #
  class Setup
    attr_accessor :username, :password, :logger, :base_url, :payload_store

    include Singleton

    # @param block [Proc]
    #
    def self.setup
      instance.payload_store = Hash.new
      yield(instance) if block_given?
    end

    def self.method_missing(method_name, *args, &block)
      instance.send method_name, *args, &block
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
foot_stats-0.1.0 lib/foot_stats/setup.rb