Class: Furnace::AVM2::ABC::TraitInfo
- Inherits:
-
Record
- Object
- Binary::Record
- Record
- Furnace::AVM2::ABC::TraitInfo
- Defined in:
- lib/furnace-avm2/abc/metadata/trait_info.rb
Constant Summary collapse
- XlatTable =
{ :Slot => 0, :Method => 1, :Getter => 2, :Setter => 3, :Class => 4, :Function => 5, :Const => 6 }
- TRAIT_FINAL =
0x01
- TRAIT_OVERRIDE =
0x02
- TRAIT_METADATA =
0x04
Instance Attribute Summary collapse
-
#kind_raw ⇒ Object
Returns the value of attribute kind_raw.
Attributes inherited from Binary::Record
Instance Method Summary collapse
- #method_missing(method, *args, &block) ⇒ Object
- #read_attributes(io, options) ⇒ Object
- #to_astlet ⇒ Object
- #write_attributes(io, value, options) ⇒ Object
Methods inherited from Record
abc_array_of, flag, pool_array, pool_array_of, pool_ref, subset, xlat_direct, xlat_field, xlat_inverse
Methods inherited from Binary::Record
#byte_length, codegen, codegen_each, inherited, #inspect, method_missing, register, #to_hash, trace, trace_scope, trace_value
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &block) ⇒ Object
56 57 58 |
# File 'lib/furnace-avm2/abc/metadata/trait_info.rb', line 56 def method_missing(method, *args, &block) data.send(method, *args, &block) end |
Instance Attribute Details
#kind_raw ⇒ Object
Returns the value of attribute kind_raw.
17 18 19 |
# File 'lib/furnace-avm2/abc/metadata/trait_info.rb', line 17 def kind_raw @kind_raw end |
Instance Method Details
#read_attributes(io, options) ⇒ Object
19 20 21 22 23 24 25 26 |
# File 'lib/furnace-avm2/abc/metadata/trait_info.rb', line 19 def read_attributes(io, ) byte = io.read(1).unpack("C").at(0) value = byte >> 4 @kind_raw = byte & 0xF value end |
#to_astlet ⇒ Object
60 61 62 |
# File 'lib/furnace-avm2/abc/metadata/trait_info.rb', line 60 def to_astlet data.to_astlet(self) end |
#write_attributes(io, value, options) ⇒ Object
28 29 30 31 32 |
# File 'lib/furnace-avm2/abc/metadata/trait_info.rb', line 28 def write_attributes(io, value, ) byte = (value << 4) | (@kind_raw & 0xf) io.write([ byte ].pack("C")) end |