Class: MachO::MachOView
- Inherits:
-
Object
- Object
- MachO::MachOView
- Defined in:
- lib/macho/view.rb
Overview
A representation of some unspecified Mach-O data.
Instance Attribute Summary collapse
-
#endianness ⇒ Symbol
readonly
The endianness of the data (
:big
or:little
). -
#offset ⇒ Integer
readonly
The offset of the relevant data (in #raw_data).
-
#raw_data ⇒ String
readonly
The raw Mach-O data.
Instance Method Summary collapse
-
#initialize(raw_data, endianness, offset) ⇒ MachOView
constructor
Creates a new MachOView.
-
#to_h ⇒ Hash
A hash representation of this MachOView.
Constructor Details
#initialize(raw_data, endianness, offset) ⇒ MachOView
Creates a new MachOView.
19 20 21 22 23 |
# File 'lib/macho/view.rb', line 19 def initialize(raw_data, endianness, offset) @raw_data = raw_data @endianness = endianness @offset = offset end |
Instance Attribute Details
#endianness ⇒ Symbol (readonly)
Returns the endianness of the data (:big
or :little
).
10 11 12 |
# File 'lib/macho/view.rb', line 10 def endianness @endianness end |
#offset ⇒ Integer (readonly)
Returns the offset of the relevant data (in #raw_data).
13 14 15 |
# File 'lib/macho/view.rb', line 13 def offset @offset end |
#raw_data ⇒ String (readonly)
Returns the raw Mach-O data.
7 8 9 |
# File 'lib/macho/view.rb', line 7 def raw_data @raw_data end |
Instance Method Details
#to_h ⇒ Hash
Returns a hash representation of this MachO::MachOView.
26 27 28 29 30 31 |
# File 'lib/macho/view.rb', line 26 def to_h { "endianness" => endianness, "offset" => offset, } end |