Class: EssCee::Service
- Inherits:
-
Object
- Object
- EssCee::Service
- Defined in:
- lib/service.rb
Instance Attribute Summary collapse
-
#display_name ⇒ Object
readonly
Returns the value of attribute display_name.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#state ⇒ Object
readonly
Returns the value of attribute state.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(hostname, details) ⇒ Service
constructor
A new instance of Service.
- #start ⇒ Object
- #stop ⇒ Object
Constructor Details
#initialize(hostname, details) ⇒ Service
Returns a new instance of Service.
5 6 7 |
# File 'lib/service.rb', line 5 def initialize(hostname, details) @hostname, @name, @display_name, @type, @state = hostname, details[:name], details[:display_name], details[:type], details[:state] end |
Instance Attribute Details
#display_name ⇒ Object (readonly)
Returns the value of attribute display_name.
3 4 5 |
# File 'lib/service.rb', line 3 def display_name @display_name end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/service.rb', line 3 def name @name end |
#state ⇒ Object (readonly)
Returns the value of attribute state.
3 4 5 |
# File 'lib/service.rb', line 3 def state @state end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
3 4 5 |
# File 'lib/service.rb', line 3 def type @type end |
Instance Method Details
#start ⇒ Object
13 14 15 |
# File 'lib/service.rb', line 13 def start %x[sc \\\\#{@hostname} start #{@name}] end |
#stop ⇒ Object
9 10 11 |
# File 'lib/service.rb', line 9 def stop %x[sc \\\\#{@hostname} stop #{@name}] end |