Class: Faceter::Rules::AppendNested Private
- Inherits:
-
AbstractMapper::PairRule
- Object
- AbstractMapper::PairRule
- Faceter::Rules::AppendNested
- Defined in:
- lib/faceter/rules/append_nested.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Does the same as [Faceter::Rules::PrependNested] in case ‘nested’ transformation follows the ‘List`, not prepends it.
Instance Method Summary collapse
- #optimize ⇒ Object private
- #optimize? ⇒ Boolean private
Instance Method Details
#optimize ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
20 21 22 |
# File 'lib/faceter/rules/append_nested.rb', line 20 def optimize Nodes::List.new { left.entries + (right.nested ? [right] : []) } end |
#optimize? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
15 16 17 |
# File 'lib/faceter/rules/append_nested.rb', line 15 def optimize? left.instance_of?(Nodes::List) && right.respond_to?(:nested) end |