class SkullIsland::APIClient

The API Client Singleton class

Public Class Methods

about_service() click to toggle source
# File lib/skull_island/api_client.rb, line 12
def self.about_service
  instance.about_service
end
configure(opts = {}) click to toggle source
# File lib/skull_island/api_client.rb, line 8
def self.configure(opts = {})
  instance.configure(opts)
end
lru_cache() click to toggle source
# File lib/skull_island/api_client.rb, line 16
def self.lru_cache
  instance.lru_cache
end
server_status() click to toggle source
# File lib/skull_island/api_client.rb, line 20
def self.server_status
  instance.server_status
end

Public Instance Methods

configure(opts = {}) click to toggle source
# File lib/skull_island/api_client.rb, line 24
def configure(opts = {})
  # validations
  validate_opts(opts)

  # Set up the client's state
  @server     = opts[:server] || 'http://localhost:8001'
  @username   = opts[:username]
  @password   = opts[:password]
  @cache      = LRUCache.new(1000) # LRU cache of up to 1000 items
  @configured = true
end