Class: Ast::Ast::TokenDesc

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

Overview

See Also:

  • #token

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, &block) ⇒ TokenDesc

Returns a new instance of TokenDesc.



9
10
11
12
# File 'lib/ast_ast/ast.rb', line 9

def initialize(name, &block)
  @name = name
  @block = block || Proc.new {|t| t}
end

Instance Attribute Details

#blockObject

Returns the value of attribute block.



7
8
9
# File 'lib/ast_ast/ast.rb', line 7

def block
  @block
end

#nameObject

Returns the value of attribute name.



7
8
9
# File 'lib/ast_ast/ast.rb', line 7

def name
  @name
end