Class: SyntaxTree::HashKeyFormatter::Labels

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

Instance Method Summary collapse

Instance Method Details

#format_key(q, key) ⇒ Object



1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
# File 'lib/syntax_tree/node.rb', line 1285

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