Class: Pid
- Inherits:
-
Object
- Object
- Pid
- Defined in:
- lib/common/pid.rb
Instance Attribute Summary collapse
-
#pid ⇒ Object
readonly
Returns the value of attribute pid.
Instance Method Summary collapse
-
#initialize ⇒ Pid
constructor
A new instance of Pid.
- #to_s ⇒ Object
- #write_to_file(fileName) ⇒ Object
Constructor Details
#initialize ⇒ Pid
Returns a new instance of Pid.
25 26 27 |
# File 'lib/common/pid.rb', line 25 def initialize @pid = Process.pid end |
Instance Attribute Details
#pid ⇒ Object (readonly)
Returns the value of attribute pid.
22 23 24 |
# File 'lib/common/pid.rb', line 22 def pid @pid end |
Instance Method Details
#to_s ⇒ Object
41 42 43 |
# File 'lib/common/pid.rb', line 41 def to_s @pid.to_s end |
#write_to_file(fileName) ⇒ Object
30 31 32 33 34 35 36 37 38 |
# File 'lib/common/pid.rb', line 30 def write_to_file( fileName ) if ( fileName == nil ) raise IOException( 'File name is nil' ) end pidHandle = File.new( fileName, 'w' ) pidHandle.print( pid ) pidHandle.close end |