Class: TwitterJekyll::ApiRequest Private

Inherits:
Struct
  • Object
show all
Defined in:
lib/jekyll-twitter-plugin-2.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Holds the URI were going to request with any parameters

Constant Summary collapse

TWITTER_API_URL =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

"https://publish.twitter.com/oembed".freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#entity_urlObject

Returns the value of attribute entity_url

Returns:

  • (Object)

    the current value of entity_url



110
111
112
# File 'lib/jekyll-twitter-plugin-2.rb', line 110

def entity_url
  @entity_url
end

#paramsObject

Returns the value of attribute params

Returns:

  • (Object)

    the current value of params



110
111
112
# File 'lib/jekyll-twitter-plugin-2.rb', line 110

def params
  @params
end

Instance Method Details

#cache_keyObject

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.

A cache key applicable to the current request with params



126
127
128
# File 'lib/jekyll-twitter-plugin-2.rb', line 126

def cache_key
  Digest::MD5.hexdigest("#{self.class.name}-#{unique_request_key}")
end

#ssl?Boolean

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.

Always;

Returns:

  • (Boolean)


114
115
116
# File 'lib/jekyll-twitter-plugin-2.rb', line 114

def ssl?
  true
end

#to_uriObject

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.

Return a URI for Twitter API with query params



119
120
121
122
123
# File 'lib/jekyll-twitter-plugin-2.rb', line 119

def to_uri
  URI.parse(TWITTER_API_URL).tap do |uri|
    uri.query = URI.encode_www_form url_params
  end
end