Class: SerpCheap::Rails::CachedClient

Inherits:
Object
  • Object
show all
Defined in:
lib/serpcheap/rails/cached_client.rb

Instance Method Summary collapse

Constructor Details

#initialize(sdk, configuration) ⇒ CachedClient

Returns a new instance of CachedClient.



9
10
11
12
# File 'lib/serpcheap/rails/cached_client.rb', line 9

def initialize(sdk, configuration)
  @sdk = sdk
  @configuration = configuration
end

Instance Method Details

#rank(url, query, **opts) ⇒ Object



26
27
28
# File 'lib/serpcheap/rails/cached_client.rb', line 26

def rank(url, query, **opts)
  fetch("rank", [url, query, opts]) { @sdk.rank(url, query, **opts) }
end

#rawObject



14
15
16
# File 'lib/serpcheap/rails/cached_client.rb', line 14

def raw
  @sdk
end

#scrape(url, **opts) ⇒ Object



22
23
24
# File 'lib/serpcheap/rails/cached_client.rb', line 22

def scrape(url, **opts)
  fetch("scrape", [url, opts]) { @sdk.scrape(url, **opts) }
end

#search(query, **opts) ⇒ Object



18
19
20
# File 'lib/serpcheap/rails/cached_client.rb', line 18

def search(query, **opts)
  fetch("search", [query, opts]) { @sdk.search(query, **opts) }
end