Class: HaveAPI::Authentication::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/haveapi/authentication/base.rb

Overview

Base class for authentication providers.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(server, v) ⇒ Base

Returns a new instance of Base.



7
8
9
10
11
# File 'lib/haveapi/authentication/base.rb', line 7

def initialize(server, v)
  @server = server
  @version = v
  setup
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



5
6
7
# File 'lib/haveapi/authentication/base.rb', line 5

def name
  @name
end

#resourcesObject

Returns the value of attribute resources.



5
6
7
# File 'lib/haveapi/authentication/base.rb', line 5

def resources
  @resources
end

Instance Method Details

#authenticate(request) ⇒ Object

Reimplement this method in your authentication provider. request is passed directly from Sinatra.



15
16
17
# File 'lib/haveapi/authentication/base.rb', line 15

def authenticate(request)

end

#describeObject

Reimplement to describe provider.



20
21
22
# File 'lib/haveapi/authentication/base.rb', line 20

def describe
  {}
end