Module: Danica::Common
- Extended by:
- ActiveSupport::Concern
- Included in:
- Expression, Function::Name, VariablesHolder, Wrapper::Constant, Wrapper::Container, Wrapper::Group, Wrapper::Number, Wrapper::Variable
- Defined in:
- lib/danica/common.rb
Instance Method Summary collapse
- #content ⇒ Object
- #formatted(*args) ⇒ Object
- #gnu(**options) ⇒ Object
- #tex(**options) ⇒ Object
- #to(format, **options) ⇒ Object
- #to_f ⇒ Object
- #to_gnu(**options) ⇒ Object
- #to_tex(**options) ⇒ Object
- #valued? ⇒ Boolean
Instance Method Details
#content ⇒ Object
70 71 72 |
# File 'lib/danica/common.rb', line 70 def content self end |
#formatted(*args) ⇒ Object
60 61 62 |
# File 'lib/danica/common.rb', line 60 def formatted(*args) Formatted.new(self, *args) end |
#gnu(**options) ⇒ Object
56 57 58 |
# File 'lib/danica/common.rb', line 56 def gnu(**) formatted(format: :gnu, **) end |
#tex(**options) ⇒ Object
52 53 54 |
# File 'lib/danica/common.rb', line 52 def tex(**) formatted(format: :tex, **) end |
#to(format, **options) ⇒ Object
39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/danica/common.rb', line 39 def to(format, **) case format.to_sym when :tex to_tex() when :gnu to_gnu() when :f to_f else raise Exception::FormattedNotFound end end |
#to_f ⇒ Object
27 28 29 |
# File 'lib/danica/common.rb', line 27 def to_f raise Exception::NotImplemented end |
#to_gnu(**options) ⇒ Object
35 36 37 |
# File 'lib/danica/common.rb', line 35 def to_gnu(**) to(:gnu, ) end |
#to_tex(**options) ⇒ Object
31 32 33 |
# File 'lib/danica/common.rb', line 31 def to_tex(**) to(:tex, ) end |
#valued? ⇒ Boolean
64 65 66 67 68 |
# File 'lib/danica/common.rb', line 64 def valued? to_f.present? rescue Exception::NotDefined false end |