Class: SpecTools::Watch

Inherits:
Object
  • Object
show all
Extended by:
SpecToolsExtensions
Includes:
SpecToolsExtensions
Defined in:
lib/spectools.rb,
lib/vnmsh.rb

Overview

SpecTools::Watch

Represents a SpectroWATCH

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

#idObject

The watch’s ID (analogous to an Attr ID)



591
592
593
# File 'lib/spectools.rb', line 591

def id
  @id
end

#nameObject

The watch’s name



593
594
595
# File 'lib/spectools.rb', line 593

def name
  @name
end

#statusObject

The watch’s status



597
598
599
# File 'lib/spectools.rb', line 597

def status
  @status
end

#typeObject

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