Class: Prb::Opts

Inherits:
Object
  • Object
show all
Defined in:
lib/prb/opts.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(opts) ⇒ Opts

Returns a new instance of Opts.



5
6
7
8
9
10
# File 'lib/prb/opts.rb', line 5

def initialize(opts)
  @pomodoros = opts[:pomodoros].to_i
  @timer = opts[:timer].to_i
  @daemonize = opts[:daemonize]
  @port = (opts[:port] || 3838).to_i
end

Instance Attribute Details

#pomodorosObject (readonly)

Returns the value of attribute pomodoros.



3
4
5
# File 'lib/prb/opts.rb', line 3

def pomodoros
  @pomodoros
end

#portObject (readonly)

Returns the value of attribute port.



3
4
5
# File 'lib/prb/opts.rb', line 3

def port
  @port
end

#timerObject (readonly)

Returns the value of attribute timer.



3
4
5
# File 'lib/prb/opts.rb', line 3

def timer
  @timer
end

Instance Method Details

#daemonize?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/prb/opts.rb', line 12

def daemonize?
  !!@daemonize
end