Class: PolyglotCli::Resource::Base

Inherits:
JsonApiClient::Resource
  • Object
show all
Extended by:
Helper::Depaginate
Defined in:
lib/polyglot_cli/resources/base.rb

Direct Known Subclasses

Language, Project, Session, Translation, TranslationKey

Constant Summary

Constants included from Helper::Depaginate

Helper::Depaginate::PER_PAGE

Class Method Summary collapse

Methods included from Helper::Depaginate

depaginate_query

Class Method Details

.depaginate(opts = {}) ⇒ Object



25
26
27
# File 'lib/polyglot_cli/resources/base.rb', line 25

def self.depaginate(opts = {})
  depaginate_query(where(opts))
end

.token(token) ⇒ Object



20
21
22
23
# File 'lib/polyglot_cli/resources/base.rb', line 20

def self.token(token)
  self.connection_options = { headers: { 'X-Auth-Token' => token } }
  self
end

.with_subdomain(subdomain) ⇒ Object



15
16
17
18
# File 'lib/polyglot_cli/resources/base.rb', line 15

def self.with_subdomain(subdomain)
  self.site = site.sub(/http(s)?\:\/\//, "http\\1://#{subdomain}.")
  self
end