Class: SyntaxTree::HashKeyFormatter::Labels

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

Instance Method Summary collapse

Instance Method Details

#format_key(q, key) ⇒ Object



2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
# File 'lib/syntax_tree.rb', line 2135

def format_key(q, key)
  case key
  when Label
    q.format(key)
  when SymbolLiteral
    q.format(key.value)
    q.text(":")
  when DynaSymbol
    q.format(key)
    q.text(":")
  end
end