Class: Duby::AST::Annotation

Inherits:
Node
  • Object
show all
Defined in:
lib/duby/ast.rb

Instance Attribute Summary collapse

Attributes inherited from Node

#children, #inferred_type, #newline, #parent, #position

Instance Method Summary collapse

Methods inherited from Node

#<<, ===, #_set_parent, child, child_name, #each, #empty?, #expr?, #initialize_copy, #insert, #inspect, #line_number, #log, #precompile, #resolve_if, #resolved!, #resolved?, #simple_name, #temp, #to_s

Constructor Details

#initialize(parent, position, klass) ⇒ Annotation

Returns a new instance of Annotation.



378
379
380
381
382
# File 'lib/duby/ast.rb', line 378

def initialize(parent, position, klass)
  super(parent, position)
  @class = klass
  @values = {}
end

Instance Attribute Details

#runtimeObject Also known as: runtime?

Returns the value of attribute runtime.



375
376
377
# File 'lib/duby/ast.rb', line 375

def runtime
  @runtime
end

#valuesObject (readonly)

Returns the value of attribute values.



374
375
376
# File 'lib/duby/ast.rb', line 374

def values
  @values
end

Instance Method Details

#[](name) ⇒ Object



396
397
398
# File 'lib/duby/ast.rb', line 396

def [](name)
  @values[name]
end

#[]=(name, value) ⇒ Object



392
393
394
# File 'lib/duby/ast.rb', line 392

def []=(name, value)
  @values[name] = value
end

#nameObject



384
385
386
# File 'lib/duby/ast.rb', line 384

def name
  @class.name
end

#typeObject



388
389
390
# File 'lib/duby/ast.rb', line 388

def type
  @class
end