Class: BitStream::Char

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

Constant Summary collapse

LENGTH =
8

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.instance(props) ⇒ Object



15
16
17
# File 'lib/types/character.rb', line 15

def self.instance(props)
  @instance
end

Instance Method Details

#lengthObject



19
20
21
# File 'lib/types/character.rb', line 19

def length
  LENGTH
end

#read(s, offset) ⇒ Object



23
24
25
26
27
28
29
30
# File 'lib/types/character.rb', line 23

def read(s, offset)
  byteoffset = offset / 8
  bitoffset  = offset % 8

  value = s[byteoffset]

  return FieldInfo.new(value, LENGTH)
end

#write(s, offset, value) ⇒ Object



32
33
# File 'lib/types/character.rb', line 32

def write(s, offset, value)
end