class Decidim::Map::Frontend
A base class for front-end mapping functionality, common to all front-end map services, such as dynamic_map.rb and autocomplete.rb. Provides builder classes for the front-end.
Public Instance Methods
builder_class()
click to toggle source
Returns the builder class for the map. Allows fetching the class name dynamically also in the utility classes that extend this class.
@return [Class] The class for the builder object.
# File lib/decidim/map/frontend.rb, line 24 def builder_class self.class.const_get(:Builder) end
builder_options()
click to toggle source
Returns the default options for the builder object.
@return [Hash] The default options for the map builder.
# File lib/decidim/map/frontend.rb, line 31 def builder_options configuration end
create_builder(template, options = {})
click to toggle source
Creates a builder class for the front-end that is used to build the HTML markup related to this utility.
@param (see Decidim::Map::BuilderUtility::Builder#initialize)
@return [Decidim::Map::BuilderUtility::Builder] The builder object that
can be used to build the map's markup.
# File lib/decidim/map/frontend.rb, line 16 def create_builder(template, options = {}) builder_class.new(template, builder_options.merge(options)) end