Class: Lapillus::BookmarkablePageLink
- Inherits:
-
Container
- Object
- RenderableComponent
- Component
- Container
- Lapillus::BookmarkablePageLink
- Defined in:
- lib/lapillus/containers.rb
Instance Attribute Summary collapse
-
#page_parameters ⇒ Object
readonly
Returns the value of attribute page_parameters.
-
#page_url ⇒ Object
readonly
Returns the value of attribute page_url.
Attributes inherited from Container
Attributes inherited from Component
#behaviours, #identifier, #model, #property, #visible
Instance Method Summary collapse
-
#initialize(id, page_url, page_parameters) ⇒ BookmarkablePageLink
constructor
A new instance of BookmarkablePageLink.
- #render_to_element(element) ⇒ Object
- #url ⇒ Object
Methods inherited from Container
#[], #add, add_component, #component, fileuploadfield, image, label, listview, panel, password_textfield, #post, #render_children, textarea, textfield
Methods inherited from Component
#add_behaviour, #behaviour, #has_behaviour?, #has_model?, #has_parent?, #parent, #path, #response_page=, #session, #value, #webpage
Methods inherited from RenderableComponent
#on_render, #render_behaviours, #render_children, #render_component, #render_container, #visible?
Constructor Details
#initialize(id, page_url, page_parameters) ⇒ BookmarkablePageLink
Returns a new instance of BookmarkablePageLink.
141 142 143 144 145 |
# File 'lib/lapillus/containers.rb', line 141 def initialize(id, page_url, page_parameters) super(id) @page_url = page_url @page_parameters = page_parameters end |
Instance Attribute Details
#page_parameters ⇒ Object (readonly)
Returns the value of attribute page_parameters.
140 141 142 |
# File 'lib/lapillus/containers.rb', line 140 def page_parameters @page_parameters end |
#page_url ⇒ Object (readonly)
Returns the value of attribute page_url.
140 141 142 |
# File 'lib/lapillus/containers.rb', line 140 def page_url @page_url end |
Instance Method Details
#render_to_element(element) ⇒ Object
147 148 149 |
# File 'lib/lapillus/containers.rb', line 147 def render_to_element(element) element.add_attribute("href", url) end |
#url ⇒ Object
151 152 153 |
# File 'lib/lapillus/containers.rb', line 151 def url "#{@page_url}/"+page_parameters.sort.collect {|key, value| key.to_s+'/'+value.to_s}.join('/') end |