Class: Mobi::Header::ExthHeader::ExthRecord
- Inherits:
-
Object
- Object
- Mobi::Header::ExthHeader::ExthRecord
- Defined in:
- lib/mobi/header/exth_header.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#length ⇒ Object
readonly
Returns the value of attribute length.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(data, start) ⇒ ExthRecord
constructor
A new instance of ExthRecord.
Constructor Details
#initialize(data, start) ⇒ ExthRecord
Returns a new instance of ExthRecord.
36 37 38 39 40 41 |
# File 'lib/mobi/header/exth_header.rb', line 36 def initialize(data, start) @code, = data[start, 4].unpack('N*')[0].to_i @name = ExthHeader::RECORD_TYPES[@code] @length, = data[start + 4, 4].unpack('N*') @value = data[start + 8, length - 8] end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
34 35 36 |
# File 'lib/mobi/header/exth_header.rb', line 34 def code @code end |
#length ⇒ Object (readonly)
Returns the value of attribute length.
34 35 36 |
# File 'lib/mobi/header/exth_header.rb', line 34 def length @length end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
34 35 36 |
# File 'lib/mobi/header/exth_header.rb', line 34 def name @name end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
34 35 36 |
# File 'lib/mobi/header/exth_header.rb', line 34 def value @value end |