Class: Georgia::Portlet
- Defined in:
- app/presenters/georgia/portlet.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#portlet ⇒ Object
readonly
Returns the value of attribute portlet.
Attributes inherited from Presenter
Instance Method Summary collapse
- #handle_tag ⇒ Object
- #id ⇒ Object
-
#initialize(view_context, portlet, args = {}) ⇒ Portlet
constructor
A new instance of Portlet.
- #portlet_tag(content, options = {}) ⇒ Object
Constructor Details
#initialize(view_context, portlet, args = {}) ⇒ Portlet
Returns a new instance of Portlet.
6 7 8 9 |
# File 'app/presenters/georgia/portlet.rb', line 6 def initialize view_context, portlet, args={} @portlet = portlet super end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Georgia::Presenter
Instance Attribute Details
#portlet ⇒ Object (readonly)
Returns the value of attribute portlet.
4 5 6 |
# File 'app/presenters/georgia/portlet.rb', line 4 def portlet @portlet end |
Instance Method Details
#handle_tag ⇒ Object
19 20 21 |
# File 'app/presenters/georgia/portlet.rb', line 19 def handle_tag content_tag(:span, icon_tag('ellipsis-v'), class: 'handle') end |
#id ⇒ Object
11 12 13 |
# File 'app/presenters/georgia/portlet.rb', line 11 def id @id ||= @portlet.persisted? ? @portlet.id : rand(10 ** 8) end |
#portlet_tag(content, options = {}) ⇒ Object
15 16 17 |
# File 'app/presenters/georgia/portlet.rb', line 15 def portlet_tag content, ={} content_tag :li, content, .reverse_merge(class: 'portlet', id: dom_id(portlet), data: {portlet: id}) end |