class JavaClass::ClassFile::Attributes::Attributes
General container of the attributes.
- Author
-
Peter Kofler
Attributes
size[R]
Size of the whole attributes structure in bytes.
Public Class Methods
new(data, start, constant_pool)
click to toggle source
Parse the attributes structure from the bytes data beginning at position start.
# File lib/javaclass/classfile/attributes/attributes.rb, line 13 def initialize(data, start, constant_pool) creator = AttributesCreator.new(data, start, constant_pool) creator.create! @attributes = creator.attributes @size = creator.size end
Public Instance Methods
with(name)
click to toggle source
Find the attribute with the given name.
# File lib/javaclass/classfile/attributes/attributes.rb, line 21 def with(name) @attributes.find { |attr| attr.name == name } end