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.
11 12 13 14 15 16 17 18 19 |
# File 'lib/android/dex/dex_object.rb', line 11 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.
9 10 11 |
# File 'lib/android/dex/dex_object.rb', line 9 def size @size end |
Instance Method Details
#[](sym) ⇒ Object
Returns dex header value which is related with sym.
29 30 31 |
# File 'lib/android/dex/dex_object.rb', line 29 def [](sym) @params[sym.to_sym] end |
#inspect ⇒ String
34 35 36 37 38 39 40 |
# File 'lib/android/dex/dex_object.rb', line 34 def inspect str = "<#{self.class}\n".dup @params.each do |key,val| str.concat " #{key}: #{val}\n" end str.concat '>' end |
#symbols ⇒ Array<Symbol>
returns symbol keys
23 24 25 |
# File 'lib/android/dex/dex_object.rb', line 23 def symbols @params.keys end |