Class: Repubmark::Elems::Power
- Inherits:
-
Base
- Object
- Base
- Repubmark::Elems::Power
show all
- Defined in:
- lib/repubmark/elems/power.rb
Instance Attribute Summary
Attributes inherited from Base
#parent
Instance Method Summary
collapse
Methods inherited from Base
#absolute_url, #config, #count_words, #html_class, #own_url, parent?, parents, #relative_url
Constructor Details
#initialize(parent, base, exponent) ⇒ Power
Returns a new instance of Power.
8
9
10
11
12
13
|
# File 'lib/repubmark/elems/power.rb', line 8
def initialize(parent, base, exponent)
super parent
@base = Integer base
@exponent = Integer exponent
end
|
Instance Method Details
#to_gemtext ⇒ Object
25
|
# File 'lib/repubmark/elems/power.rb', line 25
def to_gemtext = "#@base#{unicode_exponent}".freeze
|
#to_html ⇒ Object
23
|
# File 'lib/repubmark/elems/power.rb', line 23
def to_html = "#@base<sup>#@exponent</sup>".freeze
|
#to_summary_plain ⇒ Object
21
|
# File 'lib/repubmark/elems/power.rb', line 21
def to_summary_plain = "#@base#{unicode_exponent}".freeze
|
#unicode_exponent ⇒ Object
29
30
31
|
# File 'lib/repubmark/elems/power.rb', line 29
def unicode_exponent
@unicode_exponent ||= Repubmark.unicode_sup @exponent
end
|
#word_count ⇒ Object
19
|
# File 'lib/repubmark/elems/power.rb', line 19
def word_count = 1
|