Class: Ovec::CombinedNode

Inherits:
Node
  • Object
show all
Defined in:
lib/ovec/nodes.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(content = []) ⇒ CombinedNode

Returns a new instance of CombinedNode.



105
106
107
# File 'lib/ovec/nodes.rb', line 105

def initialize(content = [])
	@content = content
end

Instance Attribute Details

#contentObject (readonly)

Returns the value of attribute content.



125
126
127
# File 'lib/ovec/nodes.rb', line 125

def content
  @content
end

Instance Method Details

#<<(thing) ⇒ Object



109
110
111
# File 'lib/ovec/nodes.rb', line 109

def <<(thing)
	@content << thing
end

#[](index) ⇒ Object



121
122
123
# File 'lib/ovec/nodes.rb', line 121

def [](index)
	@content[index]
end

#lengthObject



117
118
119
# File 'lib/ovec/nodes.rb', line 117

def length
	@content.length
end

#to_texObject



113
114
115
# File 'lib/ovec/nodes.rb', line 113

def to_tex()
	content.map(&:to_tex).join('')
end