Class: StatsLite::Configuration
- Inherits:
-
Object
- Object
- StatsLite::Configuration
- Defined in:
- lib/stats_lite/configure.rb
Instance Method Summary collapse
- #app ⇒ Object
- #cron {|@rufus_wrapper.instance| ... } ⇒ Object
- #data(_data = nil) ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #password(_pass = nil) ⇒ Object
- #port(_port = nil) ⇒ Object
- #rack(&block) ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
5 6 7 |
# File 'lib/stats_lite/configure.rb', line 5 def initialize @port = 9111 end |
Instance Method Details
#app ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'lib/stats_lite/configure.rb', line 18 def app _app = StatsLite::App if block_given? yield app else _app end end |
#cron {|@rufus_wrapper.instance| ... } ⇒ Object
35 36 37 38 |
# File 'lib/stats_lite/configure.rb', line 35 def cron @rufus_wrapper ||= StatsLite::RufusWrapper.new yield @rufus_wrapper.instance end |
#data(_data = nil) ⇒ Object
31 32 33 |
# File 'lib/stats_lite/configure.rb', line 31 def data(_data = nil) _data ? @data = _data : @data end |
#password(_pass = nil) ⇒ Object
27 28 29 |
# File 'lib/stats_lite/configure.rb', line 27 def password(_pass = nil) _pass ? @password = _pass : @password end |
#port(_port = nil) ⇒ Object
9 10 11 |
# File 'lib/stats_lite/configure.rb', line 9 def port(_port = nil) _port ? @port = _port : @port end |
#rack(&block) ⇒ Object
13 14 15 16 |
# File 'lib/stats_lite/configure.rb', line 13 def rack(&block) return @rack unless block_given? @rack = block end |