Class: WORF::Tag::FixedWidthTag

Inherits:
WORF::Tag show all
Defined in:
lib/worf.rb

Constant Summary

Constants inherited from WORF::Tag

FORM_TO_UNPACK, UNPACK_TO_LEN

Instance Attribute Summary

Attributes inherited from WORF::Tag

#index, #type

Instance Method Summary collapse

Methods inherited from WORF::Tag

#attribute_info, build, #has_children?, #identifier, #index_of, #inspect, #user?

Constructor Details

#initialize(index, type, has_children, attr_names, attr_forms, unpack, readlen) ⇒ FixedWidthTag

Returns a new instance of FixedWidthTag.



50
51
52
53
54
# File 'lib/worf.rb', line 50

def initialize index, type, has_children, attr_names, attr_forms, unpack, readlen
  super(index, type, has_children, attr_names, attr_forms)
  @unpack = unpack
  @readlen = readlen
end

Instance Method Details

#decode(io, _) ⇒ Object



56
57
58
# File 'lib/worf.rb', line 56

def decode io, _
  io.read(@readlen).unpack(@unpack)
end