Class: Jekyll::JamComments::Service
- Inherits:
-
Object
- Object
- Jekyll::JamComments::Service
- Defined in:
- lib/jekyll_jam_comments/service.rb
Instance Attribute Summary collapse
-
#api_key ⇒ Object
readonly
Returns the value of attribute api_key.
-
#base_url ⇒ Object
readonly
Returns the value of attribute base_url.
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#copy ⇒ Object
readonly
Returns the value of attribute copy.
-
#domain ⇒ Object
readonly
Returns the value of attribute domain.
-
#environment ⇒ Object
readonly
Returns the value of attribute environment.
-
#tz ⇒ Object
readonly
Returns the value of attribute tz.
Instance Method Summary collapse
- #fetch(path:) ⇒ Object
-
#initialize(domain:, api_key:, base_url: nil, environment: nil, tz: nil, copy: {}, client: HTTParty) ⇒ Service
constructor
A new instance of Service.
Constructor Details
#initialize(domain:, api_key:, base_url: nil, environment: nil, tz: nil, copy: {}, client: HTTParty) ⇒ Service
Returns a new instance of Service.
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/jekyll_jam_comments/service.rb', line 10 def initialize( domain:, api_key:, base_url: nil, environment: nil, tz: nil, copy: {}, client: HTTParty ) @tz = tz @copy = copy @client = client @domain = domain @api_key = api_key @base_url = base_url || "https://go.jamcomments.com" @environment = environment || "production" end |
Instance Attribute Details
#api_key ⇒ Object (readonly)
Returns the value of attribute api_key.
8 9 10 |
# File 'lib/jekyll_jam_comments/service.rb', line 8 def api_key @api_key end |
#base_url ⇒ Object (readonly)
Returns the value of attribute base_url.
8 9 10 |
# File 'lib/jekyll_jam_comments/service.rb', line 8 def base_url @base_url end |
#client ⇒ Object (readonly)
Returns the value of attribute client.
8 9 10 |
# File 'lib/jekyll_jam_comments/service.rb', line 8 def client @client end |
#copy ⇒ Object (readonly)
Returns the value of attribute copy.
8 9 10 |
# File 'lib/jekyll_jam_comments/service.rb', line 8 def copy @copy end |
#domain ⇒ Object (readonly)
Returns the value of attribute domain.
8 9 10 |
# File 'lib/jekyll_jam_comments/service.rb', line 8 def domain @domain end |
#environment ⇒ Object (readonly)
Returns the value of attribute environment.
8 9 10 |
# File 'lib/jekyll_jam_comments/service.rb', line 8 def environment @environment end |
#tz ⇒ Object (readonly)
Returns the value of attribute tz.
8 9 10 |
# File 'lib/jekyll_jam_comments/service.rb', line 8 def tz @tz end |
Instance Method Details
#fetch(path:) ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/jekyll_jam_comments/service.rb', line 28 def fetch(path:) = { :query => request_query_params(path), :headers => { :Authorization => "Bearer #{api_key}", :Accept => "application/json", :"X-Platform" => "jekyll", }, } send_request() end |