Class: Danica::Function::Name
- Inherits:
-
Object
- Object
- Danica::Function::Name
- Includes:
- Common
- Defined in:
- lib/danica/function/name.rb
Instance Attribute Summary collapse
-
#containers ⇒ Object
readonly
Returns the value of attribute containers.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name:, variables:) ⇒ Name
constructor
A new instance of Name.
- #to(*args) ⇒ Object
- #variables ⇒ Object
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
#containers ⇒ Object (readonly)
Returns the value of attribute containers.
6 7 8 |
# File 'lib/danica/function/name.rb', line 6 def containers @containers end |
#name ⇒ Object (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 |
#variables ⇒ Object
17 18 19 |
# File 'lib/danica/function/name.rb', line 17 def variables containers.map(&:content) end |