Class: SyntaxTree::HashFormatter::Labels

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

Instance Attribute Summary

Attributes inherited from Base

#container

Instance Method Summary collapse

Methods inherited from Base

#comments, #format, #initialize

Constructor Details

This class inherits a constructor from SyntaxTree::HashFormatter::Base

Instance Method Details

#format_key(q, key) ⇒ Object



2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
# File 'lib/syntax_tree.rb', line 2122

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