Class: Furnace::AVM2::Tokens::MetadataToken
- Inherits:
-
Code::TerminalToken
- Object
- Code::TerminalToken
- Furnace::AVM2::Tokens::MetadataToken
- Defined in:
- lib/furnace-avm2/source/declaration_tokens/metadata_token.rb
Instance Method Summary collapse
-
#initialize(origin, options = {}) ⇒ MetadataToken
constructor
A new instance of MetadataToken.
- #to_text ⇒ Object
Constructor Details
#initialize(origin, options = {}) ⇒ MetadataToken
Returns a new instance of MetadataToken.
3 4 5 |
# File 'lib/furnace-avm2/source/declaration_tokens/metadata_token.rb', line 3 def initialize(origin, ={}) super(origin, ) end |
Instance Method Details
#to_text ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/furnace-avm2/source/declaration_tokens/metadata_token.rb', line 7 def to_text if @origin. elements = [] @origin..each do |datum| values = datum.to_hash.map do |key, value| %Q[#{key || '*'}="#{value}"] end elements << "#{datum.name}(#{values.join(",")})" end "[#{elements.join(",")}]\n" else "" end end |