Class: SmaliField

Inherits:
Object
  • Object
show all
Defined in:
lib/dex-oracle/smali_field.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(class_name, field_signature) ⇒ SmaliField

Returns a new instance of SmaliField.



4
5
6
7
8
# File 'lib/dex-oracle/smali_field.rb', line 4

def initialize(class_name, field_signature)
    @class = class_name
    @descriptor = "#{class_name}->#{field_signature}"
    @name, @type = field_signature.split(':')
end

Instance Attribute Details

#classObject (readonly)

Returns the value of attribute class.



2
3
4
# File 'lib/dex-oracle/smali_field.rb', line 2

def class
  @class
end

#descriptorObject (readonly)

Returns the value of attribute descriptor.



2
3
4
# File 'lib/dex-oracle/smali_field.rb', line 2

def descriptor
  @descriptor
end

#nameObject (readonly)

Returns the value of attribute name.



2
3
4
# File 'lib/dex-oracle/smali_field.rb', line 2

def name
  @name
end

#typeObject (readonly)

Returns the value of attribute type.



2
3
4
# File 'lib/dex-oracle/smali_field.rb', line 2

def type
  @type
end

Instance Method Details

#==(other) ⇒ Object



14
15
16
# File 'lib/dex-oracle/smali_field.rb', line 14

def ==(other)
    other.class == self.class && other.state == state
end

#stateObject



18
19
20
# File 'lib/dex-oracle/smali_field.rb', line 18

def state
    [@name, @class, @type, @descriptor]
end

#to_sObject



10
11
12
# File 'lib/dex-oracle/smali_field.rb', line 10

def to_s
    @descriptor
end