Class: Stretto::Tokens::HashToken

Inherits:
Treetop::Runtime::SyntaxNode
  • Object
show all
Defined in:
lib/stretto/grammar/tokens/hash_token.rb

Overview

Subclass of a parser token that overrides the #[] method to act like a Hash

Instance Method Summary collapse

Instance Method Details

#[](key) ⇒ Object

Quack like a hash. This is to make the individual element constructor accept either a hash or a token



9
10
11
# File 'lib/stretto/grammar/tokens/hash_token.rb', line 9

def [](key)
  send(key)
end