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.
2108 2109 2110 |
# File 'lib/syntax_tree.rb', line 2108 def initialize(container) @container = container end |
Instance Attribute Details
#container ⇒ Object (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
#comments ⇒ Object
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 |