Class: Repubmark::Elems::Abbrev
- Defined in:
- lib/repubmark/elems/abbrev.rb
Instance Attribute Summary collapse
-
#abbrev ⇒ Object
Returns the value of attribute abbrev.
-
#transcript ⇒ Object
Returns the value of attribute transcript.
Attributes inherited from Base
Instance Method Summary collapse
- #escape_abbrev ⇒ Object private
- #escape_transcript ⇒ Object private
-
#initialize(parent, abbrev, transcript) ⇒ Abbrev
constructor
A new instance of Abbrev.
- #to_gemtext ⇒ Object
- #to_html ⇒ Object
- #to_summary_plain ⇒ Object
-
#word_count ⇒ Object
Basic methods #.
Methods inherited from Base
#absolute_url, #config, #count_words, #html_class, #own_url, parent?, parents, #relative_url
Constructor Details
#initialize(parent, abbrev, transcript) ⇒ Abbrev
Returns a new instance of Abbrev.
10 11 12 13 14 15 |
# File 'lib/repubmark/elems/abbrev.rb', line 10 def initialize(parent, abbrev, transcript) super parent self.abbrev = abbrev self.transcript = transcript end |
Instance Attribute Details
#abbrev ⇒ Object
Returns the value of attribute abbrev.
8 9 10 |
# File 'lib/repubmark/elems/abbrev.rb', line 8 def abbrev @abbrev end |
#transcript ⇒ Object
Returns the value of attribute transcript.
8 9 10 |
# File 'lib/repubmark/elems/abbrev.rb', line 8 def transcript @transcript end |
Instance Method Details
#escape_abbrev ⇒ Object (private)
47 |
# File 'lib/repubmark/elems/abbrev.rb', line 47 def escape_abbrev = CGI.escape_html(abbrev).freeze |
#escape_transcript ⇒ Object (private)
49 |
# File 'lib/repubmark/elems/abbrev.rb', line 49 def escape_transcript = CGI.escape_html(transcript).freeze |
#to_gemtext ⇒ Object
29 |
# File 'lib/repubmark/elems/abbrev.rb', line 29 def to_gemtext = abbrev |
#to_html ⇒ Object
25 26 27 |
# File 'lib/repubmark/elems/abbrev.rb', line 25 def to_html %(<abbr title="#{escape_transcript}">#{escape_abbrev}</abbr>).freeze end |
#to_summary_plain ⇒ Object
23 |
# File 'lib/repubmark/elems/abbrev.rb', line 23 def to_summary_plain = abbrev |
#word_count ⇒ Object
Basic methods #
21 |
# File 'lib/repubmark/elems/abbrev.rb', line 21 def word_count = 1 |