Class: Jekyll::GeoPatterns::UriImageGeoPattern

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

Instance Method Summary collapse

Constructor Details

#initialize(tag_name, text, tokens) ⇒ UriImageGeoPattern

Returns a new instance of UriImageGeoPattern.



83
84
85
86
# File 'lib/jekyll-geo-pattern.rb', line 83

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

Instance Method Details

#render(context) ⇒ Object

Raises:

  • (ArgumentError)


88
89
90
91
92
93
94
# File 'lib/jekyll-geo-pattern.rb', line 88

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).uri_image
end