Class: TwitterJekyll::TwitterTag
- Inherits:
-
Liquid::Tag
- Object
- Liquid::Tag
- TwitterJekyll::TwitterTag
- Defined in:
- lib/jekyll-twitter-plugin-2.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.
149 150 151 152 |
# File 'lib/jekyll-twitter-plugin-2.rb', line 149 def initialize(_name, params, _tokens) super @api_request = parse_params(params) end |
Instance Attribute Details
#cache=(value) ⇒ Object
for testing
147 148 149 |
# File 'lib/jekyll-twitter-plugin-2.rb', line 147 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
156 157 158 |
# File 'lib/jekyll-twitter-plugin-2.rb', line 156 def self.cache_klass FileCache end |
Instance Method Details
#render(context) ⇒ Object
Return html string for Jekyll engine
162 163 164 165 166 |
# File 'lib/jekyll-twitter-plugin-2.rb', line 162 def render(context) api_secrets_deprecation_warning(context) # TODO: remove after deprecation cycle response = cached_response || live_response html_output_for(response) end |