Class: Decidim::Map::Frontend::Builder

Inherits:
Object
  • Object
show all
Defined in:
lib/decidim/map/frontend.rb

Overview

A general builder for any functionality needed for the views. Provides all the necessary functionality to display and initialize the front-end elements related to the given map utility.

Direct Known Subclasses

Autocomplete::Builder, DynamicMap::Builder

Instance Method Summary collapse

Constructor Details

#initialize(template, options) ⇒ Builder

Initializes the map builder instance.

Parameters:

  • template (ActionView::Template)

    The template within which the map is displayed.

  • options (Hash)

    Extra options for the builder object.



44
45
46
47
# File 'lib/decidim/map/frontend.rb', line 44

def initialize(template, options)
  @template = template
  @options = options
end

Instance Method Details

#javascript_snippetsString?

Displays the necessary front-end JavaScript assets for the map element.

Returns:

  • (String, nil)

    The map element’s JavaScript assets markup for the view or nil if there are no JavaScript assets.



61
# File 'lib/decidim/map/frontend.rb', line 61

def javascript_snippets; end

#stylesheet_snippetsString?

Displays the necessary front-end stylesheet assets for the map element.

Returns:

  • (String, nil)

    The map element’s stylesheet assets markup for the view or nil if there are no stylesheet assets.



54
# File 'lib/decidim/map/frontend.rb', line 54

def stylesheet_snippets; end