Class: Android::Dex::DexObject
- Inherits:
-
Object
- Object
- Android::Dex::DexObject
- Defined in:
- lib/android/dex/dex_object.rb
Overview
parsing dex object
Direct Known Subclasses
ClassDataItem, ClassDefItem, CodeItem, DebugInfoItem, EncodedCatchHandler, EncodedCatchHandlerList, EncodedField, EncodedMethod, EncodedTypeAddrPair, FieldIdItem, Header, IdsList, MapItem, MapList, MethodIdItem, ProtoIdItem, StringDataItem, TryItem, TypeList
Defined Under Namespace
Classes: ClassDataItem, ClassDefItem, CodeItem, DebugInfoItem, EncodedCatchHandler, EncodedCatchHandlerList, EncodedField, EncodedMethod, EncodedTypeAddrPair, FieldIdItem, Header, IdsList, MapItem, MapList, MethodIdItem, ProtoIdItem, StringDataItem, StringIdItem, TryItem, TypeIdItem, TypeList
Instance Attribute Summary collapse
-
#size ⇒ Integer
readonly
Object size.
Instance Method Summary collapse
-
#[](sym) ⇒ Object
Dex header value which is related with sym.
-
#initialize(data, offset) ⇒ DexObject
constructor
A new instance of DexObject.
- #inspect ⇒ String
-
#symbols ⇒ Array<Symbol>
returns symbol keys.
Constructor Details
#initialize(data, offset) ⇒ DexObject
Returns a new instance of DexObject.
10 11 12 13 14 15 16 17 18 |
# File 'lib/android/dex/dex_object.rb', line 10 def initialize(data, offset) @data = data @offset = offset @params = {} @parsing_off = 0 # parsing offset parse() @size = @parsing_off end |
Instance Attribute Details
#size ⇒ Integer (readonly)
Returns object size.
8 9 10 |
# File 'lib/android/dex/dex_object.rb', line 8 def size @size end |
Instance Method Details
#[](sym) ⇒ Object
Returns dex header value which is related with sym.
28 29 30 |
# File 'lib/android/dex/dex_object.rb', line 28 def [](sym) @params[sym.to_sym] end |
#inspect ⇒ String
33 34 35 36 37 38 39 |
# File 'lib/android/dex/dex_object.rb', line 33 def inspect str = "<#{self.class}\n" @params.each do |key,val| str.concat " #{key}: #{val}\n" end str.concat '>' end |
#symbols ⇒ Array<Symbol>
returns symbol keys
22 23 24 |
# File 'lib/android/dex/dex_object.rb', line 22 def symbols @params.keys end |