Class: Repubmark::Elems::Paragraph
- Defined in:
- lib/repubmark/elems/paragraph.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(parent) ⇒ Paragraph
constructor
A new instance of Paragraph.
- #method_missing(method_name) ⇒ Object
-
#respond_to_missing?(method_name, _include_private) ⇒ Boolean
Builder methods #.
- #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
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name) ⇒ Object
33 34 35 36 37 38 39 |
# File 'lib/repubmark/elems/paragraph.rb', line 33 def method_missing(method_name, ...) if @caption.respond_to?(method_name) @caption.public_send(method_name, ...) else super end end |
Instance Method Details
#respond_to_missing?(method_name, _include_private) ⇒ Boolean
Builder methods #
29 30 31 |
# File 'lib/repubmark/elems/paragraph.rb', line 29 def respond_to_missing?(method_name, _include_private) @caption.respond_to?(method_name) || super end |
#to_gemtext ⇒ Object
23 |
# File 'lib/repubmark/elems/paragraph.rb', line 23 def to_gemtext = "#{@caption.to_gemtext}\n".freeze |
#to_html ⇒ Object
21 |
# File 'lib/repubmark/elems/paragraph.rb', line 21 def to_html = "<p>\n#{@caption.to_html}</p>\n".freeze |
#to_summary_plain ⇒ Object
19 |
# File 'lib/repubmark/elems/paragraph.rb', line 19 def to_summary_plain = @caption.to_summary_plain |
#word_count ⇒ Object
Basic methods #
17 |
# File 'lib/repubmark/elems/paragraph.rb', line 17 def word_count = @caption.word_count |