class SyntaxTree::HshPtn::KeywordFormatter
Formats a key-value pair in a hash pattern. The value is optional.
Attributes
Public Class Methods
Source
# File lib/syntax_tree/node.rb, line 6018 def initialize(key, value) @key = key @value = value end
Public Instance Methods
Source
# File lib/syntax_tree/node.rb, line 6027 def format(q) HashKeyFormatter::Labels.new.format_key(q, key) if value q.text(" ") q.format(value) end end