Class: SpecTools::Watch
- Inherits:
-
Object
- Object
- SpecTools::Watch
- Extended by:
- SpecToolsExtensions
- Includes:
- SpecToolsExtensions
- Defined in:
- lib/spectools.rb,
lib/vnmsh.rb
Overview
SpecTools::Watch
Represents a SpectroWATCH
Instance Attribute Summary collapse
-
#id ⇒ Object
The watch’s ID (analogous to an Attr ID).
-
#name ⇒ Object
The watch’s name.
-
#status ⇒ Object
The watch’s status.
-
#type ⇒ Object
The watch’s type.
Class Method Summary collapse
-
.cli_parse(line) ⇒ Object
Take a line of CLI
show watchoutput and populate a new Watch object.
Instance Method Summary collapse
-
#initialize(id = nil, name = nil, type = nil, status = nil) ⇒ Watch
constructor
A new instance of Watch.
Methods included from SpecToolsExtensions
call_default_extension, call_extension, method_missing, method_missing
Constructor Details
#initialize(id = nil, name = nil, type = nil, status = nil) ⇒ Watch
Returns a new instance of Watch.
599 600 601 602 603 604 |
# File 'lib/spectools.rb', line 599 def initialize(id = nil, name = nil, type = nil, status = nil) @id = id @name = name @type = type @status = status end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class SpecToolsExtensions
Instance Attribute Details
#id ⇒ Object
The watch’s ID (analogous to an Attr ID)
591 592 593 |
# File 'lib/spectools.rb', line 591 def id @id end |
#name ⇒ Object
The watch’s name
593 594 595 |
# File 'lib/spectools.rb', line 593 def name @name end |
#status ⇒ Object
The watch’s status
597 598 599 |
# File 'lib/spectools.rb', line 597 def status @status end |
#type ⇒ Object
The watch’s type
595 596 597 |
# File 'lib/spectools.rb', line 595 def type @type end |
Class Method Details
.cli_parse(line) ⇒ Object
Take a line of CLI show watch output and populate a new Watch object.
842 843 844 845 846 |
# File 'lib/vnmsh.rb', line 842 def self.cli_parse(line) id,name,type,status = line.chomp.unpack('A11A33A17A10') watch = Watch.new(id,name,type,status) return watch end |