Class: StatsLite::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/stats_lite/configure.rb

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

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

#appObject



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

Yields:

  • (@rufus_wrapper.instance)


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