Class: Jekyll::GeoPatterns::Base64GeoPattern

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

Instance Method Summary collapse

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.extract_options(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