Class: Moonrope::Authenticator

Inherits:
Object
  • Object
show all
Defined in:
lib/moonrope/authenticator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, &block) ⇒ Authenticator

Returns a new instance of Authenticator.



6
7
8
9
10
11
12
13
14
15
# File 'lib/moonrope/authenticator.rb', line 6

def initialize(name, &block)
  @name = name
  @headers = {}
  @errors = {}
  @rules = {}
  if block_given?
    dsl = Moonrope::DSL::AuthenticatorDSL.new(self)
    dsl.instance_eval(&block)
  end
end

Instance Attribute Details

#descriptionString

Returns the description for the authenticator.

Returns:

  • (String)

    the description for the authenticator



24
25
26
# File 'lib/moonrope/authenticator.rb', line 24

def description
  @description
end

#docBool

Returns whether or not the action should be documented.

Returns:

  • (Bool)

    whether or not the action should be documented



39
40
41
# File 'lib/moonrope/authenticator.rb', line 39

def doc
  @doc
end

#errorsHash (readonly)

Returns the errors this authenticator can raise.

Returns:

  • (Hash)

    the errors this authenticator can raise



33
34
35
# File 'lib/moonrope/authenticator.rb', line 33

def errors
  @errors
end

#friendly_nameString

Returns the friendly name for the authenticator.

Returns:

  • (String)

    the friendly name for the authenticator



21
22
23
# File 'lib/moonrope/authenticator.rb', line 21

def friendly_name
  @friendly_name
end

#headersHash (readonly)

Returns the headers that this authenticator uses.

Returns:

  • (Hash)

    the headers that this authenticator uses



30
31
32
# File 'lib/moonrope/authenticator.rb', line 30

def headers
  @headers
end

#lookupProc

Returns the lookup block.

Returns:

  • (Proc)

    the lookup block



27
28
29
# File 'lib/moonrope/authenticator.rb', line 27

def lookup
  @lookup
end

#nameSymbol (readonly)

Returns the name of the authenticator.

Returns:

  • (Symbol)

    the name of the authenticator



18
19
20
# File 'lib/moonrope/authenticator.rb', line 18

def name
  @name
end

#rulesHash (readonly)

Returns the rules this authenticator provides.

Returns:

  • (Hash)

    the rules this authenticator provides



36
37
38
# File 'lib/moonrope/authenticator.rb', line 36

def rules
  @rules
end