Class: SyntaxTree::HashFormatter::Base
- Inherits:
-
Object
- Object
- SyntaxTree::HashFormatter::Base
- Defined in:
- lib/syntax_tree.rb
Instance Attribute Summary collapse
-
#container ⇒ Object
readonly
- HashLiteral | BareAssocHash
-
the source of the assocs.
Instance Method Summary collapse
- #comments ⇒ Object
- #format(q) ⇒ Object
-
#initialize(container) ⇒ Base
constructor
A new instance of Base.
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
#container ⇒ Object (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
#comments ⇒ Object
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 |