Class: 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_container, textarea, textfield
Methods inherited from Component
#add_behaviour, #behaviour, #has_behaviour?, #has_model?, #has_parent?, #on_render, #parent, #path, #render_component, #response_page=, #session, #value, #visible?, #webpage
Constructor Details
#initialize(id, page_url, page_parameters) ⇒ BookmarkablePageLink
Returns a new instance of BookmarkablePageLink.
148 149 150 151 152 |
# File 'lib/lapillus/containers.rb', line 148 def initialize(id, page_url, page_parameters) super(id, nil) @page_url = page_url @page_parameters = page_parameters end |
Instance Attribute Details
#page_parameters ⇒ Object (readonly)
Returns the value of attribute page_parameters.
147 148 149 |
# File 'lib/lapillus/containers.rb', line 147 def page_parameters @page_parameters end |
#page_url ⇒ Object (readonly)
Returns the value of attribute page_url.
147 148 149 |
# File 'lib/lapillus/containers.rb', line 147 def page_url @page_url end |
Instance Method Details
#render_to_element(element) ⇒ Object
154 155 156 |
# File 'lib/lapillus/containers.rb', line 154 def render_to_element(element) element.add_attribute("href", url) end |
#url ⇒ Object
158 159 160 |
# File 'lib/lapillus/containers.rb', line 158 def url "#{@page_url}/"+page_parameters.sort.collect {|key, value| key.to_s+'/'+value.to_s}.join('/') end |