Module: Flammarion::Writeable
- Defined in:
- lib/cem/cflame/clickable_img.rb,
lib/cem/cflame/missing_html.rb,
lib/cem/cflame/progress.rb,
lib/cem/cflame/p.rb
Overview
Paragraph which can be updated easily as a mixin for Flammarion
Defined Under Namespace
Classes: ClickableImage, Paragraph, Progress
Instance Attribute Summary collapse
-
#alt ⇒ Object
Returns the value of attribute alt.
-
#height ⇒ Object
Returns the value of attribute height.
-
#title ⇒ Object
Returns the value of attribute title.
-
#url ⇒ Object
Returns the value of attribute url.
-
#width ⇒ Object
Returns the value of attribute width.
Instance Method Summary collapse
- #img_raw(url, width, height, alt, title, options = {}, &block) ⇒ Object
- #method_missing(m, *args, &block) ⇒ Object
- #p(text) ⇒ Object
- #progress(name = nil) ⇒ Object
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(m, *args, &block) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/cem/cflame/missing_html.rb', line 18 def method_missing(m, *args, &block) if !isHTML5Element(m) puts "Warning: #{m} is not a valid HTML 5 Tag" end attribs = args.last.is_a?(Hash) ? args.pop.map { |key, value| %| #{key.to_s}="#{value}"| }.join : "" if args.size == 0 puts "<#{m} #{attribs}/>", raw: true else puts args.map { |value| "<#{m} #{attribs}>#{value}</#{m}>" }.join, raw: true end end |
Instance Attribute Details
#alt ⇒ Object
Returns the value of attribute alt.
11 12 13 |
# File 'lib/cem/cflame/clickable_img.rb', line 11 def alt @alt end |
#height ⇒ Object
Returns the value of attribute height.
11 12 13 |
# File 'lib/cem/cflame/clickable_img.rb', line 11 def height @height end |
#title ⇒ Object
Returns the value of attribute title.
11 12 13 |
# File 'lib/cem/cflame/clickable_img.rb', line 11 def title @title end |
#url ⇒ Object
Returns the value of attribute url.
11 12 13 |
# File 'lib/cem/cflame/clickable_img.rb', line 11 def url @url end |
#width ⇒ Object
Returns the value of attribute width.
11 12 13 |
# File 'lib/cem/cflame/clickable_img.rb', line 11 def width @width end |
Instance Method Details
#img_raw(url, width, height, alt, title, options = {}, &block) ⇒ Object
54 55 56 |
# File 'lib/cem/cflame/clickable_img.rb', line 54 def img_raw(url, width, height, alt, title, = {}, &block) return ClickableImage.new(url, width, height, alt, title, @engraving.make_id, self, block) end |