Class: Danica::Operator::Chained
Instance Method Summary
collapse
#==
#*, #**, #+, #-, #-@, #/
#calculate, #initialize
Methods included from Common
#content, #formatted, #gnu, #tex, #to_gnu, #to_tex, #valued?
Instance Method Details
#include?(value) ⇒ Boolean
14
15
16
17
|
# File 'lib/danica/operator/chained.rb', line 14
def include?(value)
value = wrap_value(value)
variables.include?(value.content)
end
|
#to(format, **options) ⇒ Object
19
20
21
22
|
# File 'lib/danica/operator/chained.rb', line 19
def to(format, **options)
= (format, **options)
variables.procedural_join(, &join_proc(symbol(format)))
end
|
#to_f ⇒ Object
10
11
12
|
# File 'lib/danica/operator/chained.rb', line 10
def to_f
chain(variables.map(&:to_f))
end
|
#variables ⇒ Object
24
25
26
|
# File 'lib/danica/operator/chained.rb', line 24
def variables
@variables.map(&:content)
end
|
#variables=(vars) ⇒ Object
6
7
8
|
# File 'lib/danica/operator/chained.rb', line 6
def variables=(vars)
@variables = vars.map { |v| wrap_value(v) }
end
|