Sha256: b91032dfe5ca7f5d10825a7fd8802cc4c39836d2df6868e485fa72ec294b4237

Contents?: true

Size: 654 Bytes

Versions: 1

Compression:

Stored size: 654 Bytes

Contents

class ExvoAuth::Autonomous::Base
  attr_reader :options
  @@cache = ExvoAuth::Autonomous::Cache.new
  
  def initialize(options = {})
    options[:site]          ||= ExvoAuth::Config.host
    options[:client_id]     ||= ExvoAuth::Config.client_id
    options[:client_secret] ||= ExvoAuth::Config.client_secret
    @options = options
    
    validate_options!(:site, :client_id, :client_secret)
  end
  
  protected
  
  def validate_options!(*keys)
    missing = keys - options.keys
    raise(ArgumentError, "Please configure following keys: #{missing.join(", ")}") if missing.any?
  end
  
  # Makes testing easy
  def httparty
    HTTParty 
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
exvo-auth-0.6.2 lib/exvo_auth/autonomous/base.rb