Class: HMap::HMapView

Inherits:
Object
  • Object
show all
Defined in:
lib/cocoapods-hmap/view.rb

Overview

A representation of some unspecified hmap data.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(raw_data, endianness, offset) ⇒ HMapView

Creates a new HMapView.

Parameters:

  • raw_data (String)

    the raw hmap data

  • endianness (Symbol)

    the endianness of the data

  • offset (Integer)

    the offset of the relevant data



19
20
21
22
23
# File 'lib/cocoapods-hmap/view.rb', line 19

def initialize(raw_data, endianness, offset)
  @raw_data = raw_data
  @endianness = endianness
  @offset = offset
end

Instance Attribute Details

#endiannessSymbol (readonly)

Returns the endianness of the data (‘:big` or `:little`).

Returns:

  • (Symbol)

    the endianness of the data (‘:big` or `:little`)



10
11
12
# File 'lib/cocoapods-hmap/view.rb', line 10

def endianness
  @endianness
end

#offsetInteger (readonly)

Returns the offset of the relevant data (in #raw_data).

Returns:

  • (Integer)

    the offset of the relevant data (in #raw_data)



13
14
15
# File 'lib/cocoapods-hmap/view.rb', line 13

def offset
  @offset
end

#raw_dataString (readonly)

Returns the raw hmap data.

Returns:

  • (String)

    the raw hmap data



7
8
9
# File 'lib/cocoapods-hmap/view.rb', line 7

def raw_data
  @raw_data
end

Instance Method Details

#to_hHash

Returns a hash representation of this HMap::HMapView.

Returns:



26
27
28
29
30
31
# File 'lib/cocoapods-hmap/view.rb', line 26

def to_h
  {
    'endianness' => endianness,
    'offset' => offset
  }
end