Class: Bookit::Content::Link
- Defined in:
- lib/bookit/content/link.rb
Overview
Content that will be clickable to web urls. Can be images or text.
Instance Attribute Summary collapse
-
#text ⇒ Object
Returns the value of attribute text.
-
#url ⇒ Object
Returns the value of attribute url.
Attributes inherited from Generic
Instance Method Summary collapse
-
#initialize(url, objects, options = {}) ⇒ Link
constructor
A new instance of Link.
- #render ⇒ Object
Methods inherited from Generic
Constructor Details
#initialize(url, objects, options = {}) ⇒ Link
Returns a new instance of Link.
8 9 10 11 12 13 14 |
# File 'lib/bookit/content/link.rb', line 8 def initialize(url, objects, ={}) @url = url objects.compact! @objects = (objects.class == Array) ? objects : [objects] super end |
Instance Attribute Details
#text ⇒ Object
Returns the value of attribute text.
6 7 8 |
# File 'lib/bookit/content/link.rb', line 6 def text @text end |
#url ⇒ Object
Returns the value of attribute url.
6 7 8 |
# File 'lib/bookit/content/link.rb', line 6 def url @url end |
Instance Method Details
#render ⇒ Object
16 17 18 |
# File 'lib/bookit/content/link.rb', line 16 def render [@url, @objects.map(&:render)] end |