Class: Jekyll::LeafletGeoJSON
- Inherits:
-
Liquid::Tag
- Object
- Liquid::Tag
- Jekyll::LeafletGeoJSON
- Defined in:
- lib/jekyll-leaflet-mze/leaflet-items/leaflet-geojson.rb
Instance Method Summary collapse
-
#initialize(tag_name, input, tokens) ⇒ LeafletGeoJSON
constructor
A new instance of LeafletGeoJSON.
- #render(context) ⇒ Object
Constructor Details
#initialize(tag_name, input, tokens) ⇒ LeafletGeoJSON
6 7 8 9 10 11 12 13 |
# File 'lib/jekyll-leaflet-mze/leaflet-items/leaflet-geojson.rb', line 6 def initialize(tag_name, input, tokens) super if input.empty? @input = '{}' else @input = input end end |
Instance Method Details
#render(context) ⇒ Object
15 16 17 18 19 20 |
# File 'lib/jekyll-leaflet-mze/leaflet-items/leaflet-geojson.rb', line 15 def render(context) value = parse_liquid_output_in(@input, context) '{id: "' + SecureRandom.hex + '", type: "LeafletGeoJSON", value: ' + value + '},' end |