Class: Simatic::Types::Char

Inherits:
SimaticSimpleType show all
Defined in:
lib/simatic/types/char.rb

Constant Summary collapse

LENGTH =
1
PATTERN =
'a'

Class Method Summary collapse

Methods inherited from SimaticSimpleType

parse_one

Methods inherited from SimaticType

#initialize, parse, parse_one, #serialize

Constructor Details

This class inherits a constructor from Simatic::Types::SimaticType

Class Method Details

.serialize(value) ⇒ Object



9
10
11
12
# File 'lib/simatic/types/char.rb', line 9

def self.serialize value
  raise "Value must be String class (value: #{value})" unless value.kind_of? String
  [value].pack(self::PATTERN)
end