Class: Rasm::Java::Attribute

Inherits:
Object
  • Object
show all
Defined in:
lib/rasm/java/attributes.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cp, name, data) ⇒ Attribute

Returns a new instance of Attribute.



5
6
7
# File 'lib/rasm/java/attributes.rb', line 5

def initialize(cp, name, data)
  @cp, @name, @data = cp, name, data
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



4
5
6
# File 'lib/rasm/java/attributes.rb', line 4

def name
  @name
end

Class Method Details

.of(cp, name, data) ⇒ Object



14
15
16
17
18
19
20
21
# File 'lib/rasm/java/attributes.rb', line 14

def of(cp, name, data)
  case name
    when 'Code'

    else
      Attribute.new(cp, name, data)
  end
end

Instance Method Details

#valueObject



9
10
11
# File 'lib/rasm/java/attributes.rb', line 9

def value
  @cp[@data.unpack('n')[0]].val
end