Class: Ovec::TextCommandsNode

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(command, content, text: true) ⇒ TextCommandsNode

If verbatim, do not interpret content as actual text.



19
20
21
22
23
# File 'lib/ovec/nodes.rb', line 19

def initialize(command, content, text: true)
	@command = command
	@content = content
	@text = text
end

Instance Attribute Details

#commandObject (readonly)

Returns the value of attribute command.



31
32
33
# File 'lib/ovec/nodes.rb', line 31

def command
  @command
end

#contentObject (readonly)

Returns the value of attribute content.



32
33
34
# File 'lib/ovec/nodes.rb', line 32

def content
  @content
end

Instance Method Details

#text?Boolean

Returns:

  • (Boolean)


29
# File 'lib/ovec/nodes.rb', line 29

def text?; @text; end

#to_texObject



25
26
27
# File 'lib/ovec/nodes.rb', line 25

def to_tex
	"\\#@command{#{@content.to_tex}}"
end