Class: Jekyll::GeoPatterns::Base64GeoPattern
- Inherits:
-
Liquid::Tag
- Object
- Liquid::Tag
- Jekyll::GeoPatterns::Base64GeoPattern
- Defined in:
- lib/jekyll-geo-pattern.rb
Instance Method Summary collapse
-
#initialize(tag_name, text, tokens) ⇒ Base64GeoPattern
constructor
A new instance of Base64GeoPattern.
- #render(context) ⇒ Object
Constructor Details
#initialize(tag_name, text, tokens) ⇒ Base64GeoPattern
Returns a new instance of Base64GeoPattern.
22 23 24 25 26 27 |
# File 'lib/jekyll-geo-pattern.rb', line 22 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
29 30 31 32 |
# File 'lib/jekyll-geo-pattern.rb', line 29 def render(context) text = @opts.delete(:text) GeoPattern.generate(text, @opts).base64_string end |