Class: Unitsml::Extender
- Inherits:
-
Object
- Object
- Unitsml::Extender
- Defined in:
- lib/unitsml/extender.rb
Instance Attribute Summary collapse
-
#symbol ⇒ Object
Returns the value of attribute symbol.
Instance Method Summary collapse
- #==(object) ⇒ Object
-
#initialize(symbol) ⇒ Extender
constructor
A new instance of Extender.
- #to_asciimath ⇒ Object
- #to_html ⇒ Object
- #to_latex ⇒ Object
- #to_mathml ⇒ Object
- #to_unicode ⇒ Object
Constructor Details
#initialize(symbol) ⇒ Extender
Returns a new instance of Extender.
7 8 9 |
# File 'lib/unitsml/extender.rb', line 7 def initialize(symbol) @symbol = symbol end |
Instance Attribute Details
#symbol ⇒ Object
Returns the value of attribute symbol.
5 6 7 |
# File 'lib/unitsml/extender.rb', line 5 def symbol @symbol end |
Instance Method Details
#==(object) ⇒ Object
11 12 13 14 |
# File 'lib/unitsml/extender.rb', line 11 def ==(object) self.class == object.class && symbol == object&.symbol end |
#to_asciimath ⇒ Object
24 25 26 |
# File 'lib/unitsml/extender.rb', line 24 def to_asciimath symbol end |
#to_html ⇒ Object
28 29 30 |
# File 'lib/unitsml/extender.rb', line 28 def to_html "⋅" end |
#to_latex ⇒ Object
20 21 22 |
# File 'lib/unitsml/extender.rb', line 20 def to_latex "/" end |
#to_mathml ⇒ Object
16 17 18 |
# File 'lib/unitsml/extender.rb', line 16 def to_mathml Utility.ox_element("mo") << "⋅" end |
#to_unicode ⇒ Object
32 33 34 |
# File 'lib/unitsml/extender.rb', line 32 def to_unicode symbol == "*" ? "ยท" : symbol end |