Class: Metanorma::Mirror::Model::Node
- Inherits:
-
Lutaml::Model::Serializable
- Object
- Lutaml::Model::Serializable
- Metanorma::Mirror::Model::Node
- Defined in:
- lib/metanorma/mirror/model/node.rb
Instance Method Summary collapse
- #accept_rewriter(_rewriter) ⇒ Object
- #container? ⇒ Boolean
-
#initialize(type: nil, attrs: {}) ⇒ Node
constructor
**options carries framework construction kwargs (e.g. lutaml_register) through to the base serializer.
- #leaf? ⇒ Boolean
- #text_content ⇒ Object
Constructor Details
#initialize(type: nil, attrs: {}) ⇒ Node
**options carries framework construction kwargs (e.g. lutaml_register) through to the base serializer
17 18 19 20 21 |
# File 'lib/metanorma/mirror/model/node.rb', line 17 def initialize(type: nil, attrs: {}, **) # wire keys are strings; handlers and the transformer build # attrs with symbol keys super(type: type, attrs: (attrs || {}).transform_keys(&:to_s), **) end |
Instance Method Details
#accept_rewriter(_rewriter) ⇒ Object
35 36 37 38 |
# File 'lib/metanorma/mirror/model/node.rb', line 35 def accept_rewriter(_rewriter) raise NotImplementedError, "#{self.class}#accept_rewriter not implemented" end |
#container? ⇒ Boolean
27 28 29 |
# File 'lib/metanorma/mirror/model/node.rb', line 27 def container? false end |
#leaf? ⇒ Boolean
23 24 25 |
# File 'lib/metanorma/mirror/model/node.rb', line 23 def leaf? false end |
#text_content ⇒ Object
31 32 33 |
# File 'lib/metanorma/mirror/model/node.rb', line 31 def text_content "" end |