Class: Ksef::FA3::Serializer::Element
- Inherits:
-
Data
- Object
- Data
- Ksef::FA3::Serializer::Element
- Defined in:
- lib/ksef/fa3/serializer.rb
Overview
An element that carries attributes, and optionally nested elements of its own.
FA(3) has exactly two: KodFormularza, whose two attributes are fixed by the schema and
which holds text; and Zalacznik/…/Kol, whose Typ is required but not fixed and which
holds a nested NKom. The second is why children exists — this comment used to say
the model did not carry Zalacznik, which stopped being true in the commit that added
the member three lines below.
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#children ⇒ Object
readonly
Returns the value of attribute children.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
Instance Method Summary collapse
-
#initialize(text: nil, attributes: {}, children: nil) ⇒ Element
constructor
childrenarrived with the attachment:Kolcarries a requiredTypattribute and a nestedNKom, which nothing before it needed.
Constructor Details
#initialize(text: nil, attributes: {}, children: nil) ⇒ Element
children arrived with the attachment: Kol carries a required Typ attribute and
a nested NKom, which nothing before it needed. They are written through
Ksef::FA3::Serializer#write_children like any other nested element, so schema order and the
unknown-key check apply inside an attributed element too rather than being bypassed.
38 39 40 |
# File 'lib/ksef/fa3/serializer.rb', line 38 def initialize(text: nil, attributes: {}, children: nil) super end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes
33 34 35 |
# File 'lib/ksef/fa3/serializer.rb', line 33 def attributes @attributes end |
#children ⇒ Object (readonly)
Returns the value of attribute children
33 34 35 |
# File 'lib/ksef/fa3/serializer.rb', line 33 def children @children end |
#text ⇒ Object (readonly)
Returns the value of attribute text
33 34 35 |
# File 'lib/ksef/fa3/serializer.rb', line 33 def text @text end |