Sha256: d041f2520476e90c3adef2d33cf70b6b5beb9e7206232e9b98e50d96d61ada13
Contents?: true
Size: 762 Bytes
Versions: 2
Compression:
Stored size: 762 Bytes
Contents
# frozen_string_literal: true module StatsLite class Configuration def initialize @port = 9111 end def port(_port = nil) _port ? @port = _port : @port end def rack(&block) return @rack unless block_given? @rack = block end def app _app = StatsLite::App if block_given? yield app else _app end end def password(_pass = nil) _pass ? @password = _pass : @password end def data(_data = nil) _data ? @data = _data : @data end end class << self def configure config = @configuration ||= Configuration.new if block_given? yield config, StatsLite::Helper else config end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
stats_lite-0.7.2 | lib/stats_lite/configure.rb |
stats_lite-0.7.1 | lib/stats_lite/configure.rb |