Class: Danica::Function::Name

Inherits:
Object
  • Object
show all
Includes:
Common
Defined in:
lib/danica/function/name.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Common

#content, #formatted, #gnu, #tex, #to_f, #to_gnu, #to_tex, #valued?

Constructor Details

#initialize(name:, variables:) ⇒ Name

Returns a new instance of Name.



8
9
10
11
# File 'lib/danica/function/name.rb', line 8

def initialize(name:, variables:)
  @name = name || :f
  @containers = variables.map { |v| wrap_value(v) }
end

Instance Attribute Details

#containersObject (readonly)

Returns the value of attribute containers.



6
7
8
# File 'lib/danica/function/name.rb', line 6

def containers
  @containers
end

#nameObject (readonly)

Returns the value of attribute name.



6
7
8
# File 'lib/danica/function/name.rb', line 6

def name
  @name
end

Instance Method Details

#to(*args) ⇒ Object



13
14
15
# File 'lib/danica/function/name.rb', line 13

def to(*args)
  "#{name}(#{description_variables(*args)})"
end

#variablesObject



17
18
19
# File 'lib/danica/function/name.rb', line 17

def variables
  containers.map(&:content)
end