Class: Coradoc::AsciiDoc::Model::Serialization::AsciidocMappingRule
- Inherits:
-
Lutaml::Model::MappingRule
- Object
- Lutaml::Model::MappingRule
- Coradoc::AsciiDoc::Model::Serialization::AsciidocMappingRule
- Defined in:
- lib/coradoc/asciidoc/model/serialization/asciidoc_mapping_rule.rb
Instance Attribute Summary collapse
-
#field_type ⇒ Object
readonly
Can be :parsed_element, :content, or :attributes.
Instance Method Summary collapse
- #content? ⇒ Boolean
- #deep_dup ⇒ Object
-
#initialize(name, to:, render_nil: false, field_type: :attributes) ⇒ AsciidocMappingRule
constructor
A new instance of AsciidocMappingRule.
- #model_map? ⇒ Boolean
Constructor Details
#initialize(name, to:, render_nil: false, field_type: :attributes) ⇒ AsciidocMappingRule
Returns a new instance of AsciidocMappingRule.
11 12 13 14 15 16 17 18 19 |
# File 'lib/coradoc/asciidoc/model/serialization/asciidoc_mapping_rule.rb', line 11 def initialize( name, to:, render_nil: false, field_type: :attributes ) super(name, to:, render_nil:) @field_type = field_type end |
Instance Attribute Details
#field_type ⇒ Object (readonly)
Can be :parsed_element, :content, or :attributes
9 10 11 |
# File 'lib/coradoc/asciidoc/model/serialization/asciidoc_mapping_rule.rb', line 9 def field_type @field_type end |
Instance Method Details
#content? ⇒ Boolean
25 26 27 |
# File 'lib/coradoc/asciidoc/model/serialization/asciidoc_mapping_rule.rb', line 25 def content? field_type == :content end |
#deep_dup ⇒ Object
29 30 31 32 33 34 35 36 |
# File 'lib/coradoc/asciidoc/model/serialization/asciidoc_mapping_rule.rb', line 29 def deep_dup self.class.new( name.dup, to: to.dup, render_nil: render_nil.dup, field_type: ) end |
#model_map? ⇒ Boolean
21 22 23 |
# File 'lib/coradoc/asciidoc/model/serialization/asciidoc_mapping_rule.rb', line 21 def model_map? field_type == :parsed_element end |