Class: Repubmark::Elems::Iframe
- Defined in:
- lib/repubmark/elems/iframe.rb
Instance Attribute Summary collapse
-
#src ⇒ Object
Returns the value of attribute src.
-
#title ⇒ Object
Returns the value of attribute title.
-
#url ⇒ Object
Returns the value of attribute url.
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(parent, title, src, url = nil) ⇒ Iframe
constructor
A new instance of Iframe.
- #to_gemtext ⇒ Object
-
#to_html ⇒ Object
Basic methods #.
Methods inherited from Base
#absolute_url, #config, #count_words, #html_class, #own_url, parent?, parents, #relative_url, #to_summary_plain, #word_count
Constructor Details
#initialize(parent, title, src, url = nil) ⇒ Iframe
Returns a new instance of Iframe.
10 11 12 13 14 15 16 |
# File 'lib/repubmark/elems/iframe.rb', line 10 def initialize(parent, title, src, url = nil) super parent self.title = title self.src = src self.url = url || src end |
Instance Attribute Details
#src ⇒ Object
Returns the value of attribute src.
8 9 10 |
# File 'lib/repubmark/elems/iframe.rb', line 8 def src @src end |
#title ⇒ Object
Returns the value of attribute title.
8 9 10 |
# File 'lib/repubmark/elems/iframe.rb', line 8 def title @title end |
#url ⇒ Object
Returns the value of attribute url.
8 9 10 |
# File 'lib/repubmark/elems/iframe.rb', line 8 def url @url end |
Instance Method Details
#to_gemtext ⇒ Object
36 |
# File 'lib/repubmark/elems/iframe.rb', line 36 def to_gemtext = "=> #{url} #{title}\n" |
#to_html ⇒ Object
Basic methods #
22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/repubmark/elems/iframe.rb', line 22 def to_html [ "<div#{html_class(:iframe_wrap)}>\n", "<iframe\n", %(title="#{title}"\n), %(src="#{src}"\n), %(allowfullscreen=""\n), %(frameborder="0"\n), %(sandbox="allow-same-origin allow-scripts allow-popups"\n), "></iframe>\n", "</div>\n", ].join.freeze end |