Class: SyntaxTree::HashFormatter::Base

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

Direct Known Subclasses

Labels, Rockets

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(container) ⇒ Base

Returns a new instance of Base.



2108
2109
2110
# File 'lib/syntax_tree.rb', line 2108

def initialize(container)
  @container = container
end

Instance Attribute Details

#containerObject (readonly)

HashLiteral | BareAssocHash

the source of the assocs



2106
2107
2108
# File 'lib/syntax_tree.rb', line 2106

def container
  @container
end

Instance Method Details

#commentsObject



2112
2113
2114
# File 'lib/syntax_tree.rb', line 2112

def comments
  container.comments
end

#format(q) ⇒ Object



2116
2117
2118
# File 'lib/syntax_tree.rb', line 2116

def format(q)
  q.seplist(container.assocs) { |assoc| q.format(assoc) }
end