Class: CIMD::Parameter

Inherits:
Object
  • Object
show all
Defined in:
lib/cimd_structures.rb

Overview

connection

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(code, value) ⇒ Parameter

Returns a new instance of Parameter.



46
47
48
49
# File 'lib/cimd_structures.rb', line 46

def initialize(code,value)
  @code = code
  @value = value
end

Instance Attribute Details

#codeObject

Returns the value of attribute code.



43
44
45
# File 'lib/cimd_structures.rb', line 43

def code
  @code
end

#valueObject

Returns the value of attribute value.



44
45
46
# File 'lib/cimd_structures.rb', line 44

def value
  @value
end

Class Method Details

.parse(data) ⇒ Object



55
56
57
58
59
# File 'lib/cimd_structures.rb', line 55

def self.parse(data)
  fields = data.split(":")
  p = Parameter.new((fields[0]).to_i,fields[1])
  return p
end

Instance Method Details

#to_sObject



51
52
53
# File 'lib/cimd_structures.rb', line 51

def to_s
  return sprintf "%03d:%s",@code,@value
end