Class: LXC::Status
- Inherits:
-
Object
- Object
- LXC::Status
- Defined in:
- lib/lxc/status.rb
Instance Attribute Summary collapse
-
#pid ⇒ Object
readonly
Returns the value of attribute pid.
-
#state ⇒ Object
readonly
Returns the value of attribute state.
Instance Method Summary collapse
- #==(instance) ⇒ Object
-
#initialize(state, pid) ⇒ Status
constructor
A new instance of Status.
- #to_hash ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(state, pid) ⇒ Status
Returns a new instance of Status.
5 6 7 8 |
# File 'lib/lxc/status.rb', line 5 def initialize(state, pid) @state = state.to_s.downcase @pid = Integer(pid) end |
Instance Attribute Details
#pid ⇒ Object (readonly)
Returns the value of attribute pid.
3 4 5 |
# File 'lib/lxc/status.rb', line 3 def pid @pid end |
#state ⇒ Object (readonly)
Returns the value of attribute state.
3 4 5 |
# File 'lib/lxc/status.rb', line 3 def state @state end |
Instance Method Details
#==(instance) ⇒ Object
10 11 12 |
# File 'lib/lxc/status.rb', line 10 def == (instance) instance.pid == pid && instance.state == state end |
#to_hash ⇒ Object
14 15 16 |
# File 'lib/lxc/status.rb', line 14 def to_hash {'state' => state, 'pid' => pid} end |
#to_s ⇒ Object
18 19 20 |
# File 'lib/lxc/status.rb', line 18 def to_s "state=#{state} pid=#{pid}" end |