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.
53 54 55 56 |
# File 'lib/jekyll-geo-pattern.rb', line 53 def initialize(tag_name, text, tokens) super @text = text end |
Instance Method Details
#render(context) ⇒ Object
58 59 60 61 62 63 64 |
# File 'lib/jekyll-geo-pattern.rb', line 58 def render(context) opts = GeoPatterns.(@text, context) raise ArgumentError, "You must have the :text property passed in" if opts[:text].nil? GeoPattern.generate(opts[:text], opts).base64_string end |