Class: Jekyll::GeoPatterns::SVGGeoPattern

Inherits:
Liquid::Tag
  • Object
show all
Defined in:
lib/jekyll-geo-pattern.rb

Instance Method Summary collapse

Constructor Details

#initialize(tag_name, text, tokens) ⇒ SVGGeoPattern

Returns a new instance of SVGGeoPattern.



36
37
38
39
40
41
# File 'lib/jekyll-geo-pattern.rb', line 36

def initialize(tag_name, text, tokens)
  super
  if m = HASH_REGEXP.match(text)
    @opts = GeoPatterns.extract_options(m[0])
  end
end

Instance Method Details

#render(context) ⇒ Object



43
44
45
46
# File 'lib/jekyll-geo-pattern.rb', line 43

def render(context)
  text = @opts.delete(:text)
  GeoPattern.generate(text, @opts).svg_string
end