Class: Bookit::Content::Paragraph
- Defined in:
- lib/bookit/content/paragraph.rb
Instance Attribute Summary collapse
-
#contents ⇒ Object
Returns the value of attribute contents.
Attributes inherited from Generic
Instance Method Summary collapse
-
#initialize(contents, options = {}) ⇒ Paragraph
constructor
Paragraph can contain most other object types.
- #render ⇒ Object
Methods inherited from Generic
Constructor Details
#initialize(contents, options = {}) ⇒ Paragraph
Paragraph can contain most other object types. Text, images or links.
7 8 9 10 11 12 13 |
# File 'lib/bookit/content/paragraph.rb', line 7 def initialize(contents, ={}) # this could be an array of images, text, links or just a single element contents.compact! @contents = (contents.class == Array) ? contents : [contents] super end |
Instance Attribute Details
#contents ⇒ Object
Returns the value of attribute contents.
4 5 6 |
# File 'lib/bookit/content/paragraph.rb', line 4 def contents @contents end |
Instance Method Details
#render ⇒ Object
15 16 17 |
# File 'lib/bookit/content/paragraph.rb', line 15 def render @contents end |