Method: SectionRenderer#initialize

Defined in:
app/presentation/section_renderer.rb

#initialize(a_umlaut_request, section_def = {}) ⇒ SectionRenderer

First argument is the current umlaut Request object. Second argument is a session description hash. See class overview for an overview. Recognized keys of session description hash:

  • id

    SessionRenderer will look up session description hash in resolve_views finding one with :div_id == id

  • div_id

    The id of the <div> the section lives in. Also used generally as unique ID for the section.

  • service_type_values

    ServiceTypeValue’s that this section contains. defaults to [ServiceTypeValue]

  • section_title

    (DEPRECATED, use Rails i18n) Title for the section. Defaults to service_type_values.first.display_name

  • section_prompt

    Prompt. Default nil.

  • show_heading

    Show the heading section at all. Default true.

  • show_spinner

    Show a stock spinner for bg action for service_type_values. default true.

  • visibilty

    What logic to use to decide whether to show the section at all. true|false|:any_services|:in_progress|:responses_exist|:complete_with_responses|(lambda object)

  • list_visible_limit

    Use list_with_limit to limit initially displayed items to value. Default nil, meaning don’t use list_with_limit.

  • partial

    Use a custom partial to display this section, instead of using render(“standard_response_item”, :collection => [all responses]) as default.

  • show_partial_only

    Display custom partial without any of the usual standardized wrapping HTML. Custom partial will take care of it itself.

Raises:

  • (Exception)


265
266
267
268
269
270
271
272
273
274
# File 'app/presentation/section_renderer.rb', line 265

def initialize(a_umlaut_request, section_def = {})
  @umlaut_request = a_umlaut_request
  
  @div_id = section_def[:div_id] || section_def[:id]
  raise Exception.new("SectionRenderer needs a :div_id passed in arguments hash") unless @div_id
  

  # Merge in default arguments for this section from config. 
  construct_options(section_def)
end