Class: Metanorma::Mirror::HandlerResult
- Inherits:
-
Object
- Object
- Metanorma::Mirror::HandlerResult
- Defined in:
- lib/metanorma/mirror/handler_result.rb
Instance Attribute Summary collapse
-
#nodes ⇒ Object
readonly
Returns the value of attribute nodes.
Class Method Summary collapse
Instance Method Summary collapse
- #append_to(content) ⇒ Object
- #concat? ⇒ Boolean
-
#initialize(nodes, concat: false) ⇒ HandlerResult
constructor
A new instance of HandlerResult.
- #none? ⇒ Boolean
Constructor Details
#initialize(nodes, concat: false) ⇒ HandlerResult
Returns a new instance of HandlerResult.
12 13 14 15 |
# File 'lib/metanorma/mirror/handler_result.rb', line 12 def initialize(nodes, concat: false) @nodes = nodes @concat = concat end |
Instance Attribute Details
#nodes ⇒ Object (readonly)
Returns the value of attribute nodes.
6 7 8 |
# File 'lib/metanorma/mirror/handler_result.rb', line 6 def nodes @nodes end |
Class Method Details
.none ⇒ Object
8 9 10 |
# File 'lib/metanorma/mirror/handler_result.rb', line 8 def self.none new(nil, concat: false) end |
Instance Method Details
#append_to(content) ⇒ Object
25 26 27 28 29 30 31 32 33 34 |
# File 'lib/metanorma/mirror/handler_result.rb', line 25 def append_to(content) return content if none? if concat? content.concat(Array(@nodes)) else content << @nodes end content end |
#concat? ⇒ Boolean
21 22 23 |
# File 'lib/metanorma/mirror/handler_result.rb', line 21 def concat? @concat end |
#none? ⇒ Boolean
17 18 19 |
# File 'lib/metanorma/mirror/handler_result.rb', line 17 def none? @nodes.nil? end |