Class: Jekyll::GeoPatterns::SVGGeoPattern
- Inherits:
-
Liquid::Tag
- Object
- Liquid::Tag
- Jekyll::GeoPatterns::SVGGeoPattern
- Defined in:
- lib/jekyll-geo-pattern.rb
Instance Method Summary collapse
-
#initialize(tag_name, text, tokens) ⇒ SVGGeoPattern
constructor
A new instance of SVGGeoPattern.
- #render(context) ⇒ Object
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.(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 |