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.



1998
1999
2000
# File 'lib/syntax_tree.rb', line 1998

def initialize(container)
  @container = container
end

Instance Attribute Details

#containerObject (readonly)

HashLiteral | BareAssocHash

the source of the assocs



1996
1997
1998
# File 'lib/syntax_tree.rb', line 1996

def container
  @container
end

Instance Method Details

#commentsObject



2002
2003
2004
# File 'lib/syntax_tree.rb', line 2002

def comments
  container.comments
end

#format(q) ⇒ Object



2006
2007
2008
# File 'lib/syntax_tree.rb', line 2006

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