Class: Calagator::MappingHelper::Map

Inherits:
Struct
  • Object
show all
Defined in:
app/helpers/calagator/mapping_helper.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#contextObject

Returns the value of attribute context

Returns:

  • (Object)

    the current value of context



33
34
35
# File 'app/helpers/calagator/mapping_helper.rb', line 33

def context
  @context
end

#itemsObject

Returns the value of attribute items

Returns:

  • (Object)

    the current value of items



33
34
35
# File 'app/helpers/calagator/mapping_helper.rb', line 33

def items
  @items
end

#optionsObject

Returns the value of attribute options

Returns:

  • (Object)

    the current value of options



33
34
35
# File 'app/helpers/calagator/mapping_helper.rb', line 33

def options
  @options
end

Instance Method Details

#renderObject



34
35
36
37
38
# File 'app/helpers/calagator/mapping_helper.rb', line 34

def render
  return if locatable_items.empty?
  args = js_args.to_json[1...-1] # "splat" arguments by removing wrapping square brackets
  map_div + context.javascript_tag("map(#{args});")
end