Class: BasicBlock::Stem
- Inherits:
-
Object
- Object
- BasicBlock::Stem
- Defined in:
- lib/relaton_iec/basic_block/stem.rb
Constant Summary collapse
- TYPES =
%w[MathML AsciiMath].freeze
Instance Attribute Summary collapse
- #type ⇒ String readonly
Instance Method Summary collapse
-
#initialize(type:, content: []) ⇒ Stem
constructor
A new instance of Stem.
- #to_xml(builder) ⇒ Object
Constructor Details
#initialize(type:, content: []) ⇒ Stem
Returns a new instance of Stem.
12 13 14 15 16 17 18 |
# File 'lib/relaton_iec/basic_block/stem.rb', line 12 def initialize(type:, content: []) unless TYPES.include? type Util.warn "Invalud type: `#{type}`\nAllowed types are: `#{TYPES.join '`, `'}`" end @type = type @content = content end |
Instance Attribute Details
#type ⇒ String (readonly)
6 7 8 |
# File 'lib/relaton_iec/basic_block/stem.rb', line 6 def type @type end |
Instance Method Details
#to_xml(builder) ⇒ Object
23 24 25 26 27 |
# File 'lib/relaton_iec/basic_block/stem.rb', line 23 def to_xml(builder) builder.stem(type) do |b| content.each { |c| c.to_xml b } end end |