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.



70
71
72
73
# File 'lib/jekyll-geo-pattern.rb', line 70

def initialize(tag_name, text, tokens)
  super
  @text = text
end

Instance Method Details

#render(context) ⇒ Object

Raises:

  • (ArgumentError)


75
76
77
78
79
80
81
# File 'lib/jekyll-geo-pattern.rb', line 75

def render(context)
  opts = GeoPatterns.extract_options(@text, context)

  raise ArgumentError, "You must have the :text property passed in" if opts[:text].nil?

  GeoPattern.generate(opts[:text], opts).svg_string
end