Class: Omnibar::Calculate
- Inherits:
-
Query
- Object
- Query
- Omnibar::Calculate
show all
- Includes:
- Math
- Defined in:
- lib/omnibar/calculate.rb
Instance Attribute Summary
Attributes inherited from Query
#input
Instance Method Summary
collapse
Methods inherited from Query
#copy_to_clipboard, inherited, #initialize, #open_in_browser, #preview_text
Constructor Details
This class inherits a constructor from Omnibar::Query
Instance Method Details
#e ⇒ Object
24
25
26
|
# File 'lib/omnibar/calculate.rb', line 24
def e
E
end
|
16
17
18
|
# File 'lib/omnibar/calculate.rb', line 16
def perform!
copy_to_clipboard value
end
|
#pi ⇒ Object
20
21
22
|
# File 'lib/omnibar/calculate.rb', line 20
def pi
PI
end
|
#result ⇒ Object
5
6
7
8
9
10
|
# File 'lib/omnibar/calculate.rb', line 5
def result
begin
[input, value].join(' = ')
rescue Exception => _e
end
end
|
#value ⇒ Object
12
13
14
|
# File 'lib/omnibar/calculate.rb', line 12
def value
eval(input + '.to_f')
end
|