Class: Prb::Opts
- Inherits:
-
Object
- Object
- Prb::Opts
- Defined in:
- lib/prb/opts.rb
Instance Attribute Summary collapse
-
#pomodoros ⇒ Object
readonly
Returns the value of attribute pomodoros.
-
#port ⇒ Object
readonly
Returns the value of attribute port.
-
#timer ⇒ Object
readonly
Returns the value of attribute timer.
Instance Method Summary collapse
- #daemonize? ⇒ Boolean
-
#initialize(opts) ⇒ Opts
constructor
A new instance of Opts.
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
#pomodoros ⇒ Object (readonly)
Returns the value of attribute pomodoros.
3 4 5 |
# File 'lib/prb/opts.rb', line 3 def pomodoros @pomodoros end |
#port ⇒ Object (readonly)
Returns the value of attribute port.
3 4 5 |
# File 'lib/prb/opts.rb', line 3 def port @port end |
#timer ⇒ Object (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
12 13 14 |
# File 'lib/prb/opts.rb', line 12 def daemonize? !!@daemonize end |