Class: Nl::Core::NlAttr

Inherits:
Struct
  • Object
show all
Defined in:
lib/nl/core.rb,
lib/nl/core.rb

Overview

Attribute header

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#lenObject

Returns the value of attribute len

Returns:

  • (Object)

    the current value of len



72
73
74
# File 'lib/nl/core.rb', line 72

def len
  @len
end

#typeObject

Returns the value of attribute type

Returns:

  • (Object)

    the current value of type



72
73
74
# File 'lib/nl/core.rb', line 72

def type
  @type
end

Class Method Details

.decode(decoder) ⇒ Object



81
82
83
84
85
# File 'lib/nl/core.rb', line 81

def self.decode(decoder)
  obj = new(*decoder.get_values(FORMAT))
  decoder.align_to(Constants::NLA_ALIGNTO)
  obj
end

Instance Method Details

#encode(encoder) ⇒ Object



87
88
89
90
91
# File 'lib/nl/core.rb', line 87

def encode(encoder)
  encoder.reserve(Constants::NLA_HDRLEN)
  encoder.put_values(FORMAT, to_a)
  encoder.align_to(Constants::NLA_ALIGNTO)
end