Class: CmlTimer::Confing

Inherits:
Object
  • Object
show all
Defined in:
lib/cml_timer/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfing

Returns a new instance of Confing.



5
6
7
8
9
10
11
# File 'lib/cml_timer/config.rb', line 5

def initialize
  # pid file directory
  @pid_file_directory = '/tmp'

  @system_voice = 'Vicki'
  @notification_word = 'Good work!! Time up!'
end

Instance Attribute Details

#notification_wordObject

Returns the value of attribute notification_word.



3
4
5
# File 'lib/cml_timer/config.rb', line 3

def notification_word
  @notification_word
end

#pid_file_directoryObject

Returns the value of attribute pid_file_directory.



3
4
5
# File 'lib/cml_timer/config.rb', line 3

def pid_file_directory
  @pid_file_directory
end

#system_voiceObject

Returns the value of attribute system_voice.



3
4
5
# File 'lib/cml_timer/config.rb', line 3

def system_voice
  @system_voice
end

Instance Method Details

#error_processingObject



21
22
23
# File 'lib/cml_timer/config.rb', line 21

def error_processing
  STDERR.puts error_text
end

#error_text(exception) ⇒ Object



17
18
19
# File 'lib/cml_timer/config.rb', line 17

def error_text(exception)
  "[ERROR]\t#{exception}"
end

#pid_file_prefixObject



25
26
27
# File 'lib/cml_timer/config.rb', line 25

def pid_file_prefix
  'cml_timer'
end

#say_commandObject



13
14
15
# File 'lib/cml_timer/config.rb', line 13

def say_command
  %x(say -v #{@system_voice} #{@notification_word})
end