Class: Georgia::WidgetPortlet

Inherits:
Portlet show all
Defined in:
app/presenters/georgia/widget_portlet.rb

Instance Attribute Summary collapse

Attributes inherited from Portlet

#portlet

Attributes inherited from Presenter

#view_context

Instance Method Summary collapse

Methods inherited from Portlet

#handle_tag, #id, #portlet_tag

Constructor Details

#initialize(view_context, ui_association, args = {}) ⇒ WidgetPortlet

Returns a new instance of WidgetPortlet.



9
10
11
12
13
14
# File 'app/presenters/georgia/widget_portlet.rb', line 9

def initialize view_context, ui_association, args={}
  @widget = args.fetch(:widget, ui_association.widget)
  @ui_section = args.fetch(:ui_section, ui_association.ui_section)
  @revision = args.fetch(:revision, ui_association.revision)
  super
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Georgia::Presenter

Instance Attribute Details

#revisionObject (readonly)

Returns the value of attribute revision.



7
8
9
# File 'app/presenters/georgia/widget_portlet.rb', line 7

def revision
  @revision
end

#ui_sectionObject (readonly)

Returns the value of attribute ui_section.



7
8
9
# File 'app/presenters/georgia/widget_portlet.rb', line 7

def ui_section
  @ui_section
end

#widgetObject (readonly)

Returns the value of attribute widget.



7
8
9
# File 'app/presenters/georgia/widget_portlet.rb', line 7

def widget
  @widget
end

Instance Method Details

#to_sObject



16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'app/presenters/georgia/widget_portlet.rb', line 16

def to_s
  output = ActiveSupport::SafeBuffer.new
  output << handle_tag
  output << destroy_input_tag
  output << position_input_tag
  output << id_input_tag if persisted?
  output << ui_section_id_input_tag
  output << widget_id_input_tag
  output << page_id_input_tag
  output << (:div, title_tag, class: 'pull-left')
  output << actions_tag
  portlet_tag(output)
end