Class: TwitterJekyll::TwitterTag
- Inherits:
-
Liquid::Tag
- Object
- Liquid::Tag
- TwitterJekyll::TwitterTag
- Defined in:
- lib/jekyll-twitter-plugin.rb
Overview
Class to respond to Jekyll tag; entry point to library
Direct Known Subclasses
Constant Summary collapse
- ERROR_BODY_TEXT =
"<p>Tweet could not be processed</p>".freeze
- OEMBED_ARG =
"oembed".freeze
Instance Attribute Summary collapse
-
#cache ⇒ Object
writeonly
for testing.
Class Method Summary collapse
-
.cache_klass ⇒ Object
private
Class that implements caching strategy.
Instance Method Summary collapse
-
#initialize(_name, params, _tokens) ⇒ TwitterTag
constructor
A new instance of TwitterTag.
-
#render(context) ⇒ Object
Return html string for Jekyll engine.
Constructor Details
#initialize(_name, params, _tokens) ⇒ TwitterTag
Returns a new instance of TwitterTag.
147 148 149 150 |
# File 'lib/jekyll-twitter-plugin.rb', line 147 def initialize(_name, params, _tokens) super @api_request = parse_params(params) end |
Instance Attribute Details
#cache=(value) ⇒ Object
for testing
145 146 147 |
# File 'lib/jekyll-twitter-plugin.rb', line 145 def cache=(value) @cache = value end |
Class Method Details
.cache_klass ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Class that implements caching strategy
154 155 156 |
# File 'lib/jekyll-twitter-plugin.rb', line 154 def self.cache_klass FileCache end |
Instance Method Details
#render(context) ⇒ Object
Return html string for Jekyll engine
160 161 162 163 164 |
# File 'lib/jekyll-twitter-plugin.rb', line 160 def render(context) api_secrets_deprecation_warning(context) # TODO: remove after deprecation cycle response = cached_response || live_response html_output_for(response) end |