Class: Moonrope::DSL::AuthenticatorDSL

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

Instance Method Summary collapse

Constructor Details

#initialize(authenticator) ⇒ AuthenticatorDSL

Returns a new instance of AuthenticatorDSL.



5
6
7
# File 'lib/moonrope/dsl/authenticator_dsl.rb', line 5

def initialize(authenticator)
  @authenticator = authenticator
end

Instance Method Details

#description(value) ⇒ Object



13
14
15
# File 'lib/moonrope/dsl/authenticator_dsl.rb', line 13

def description(value)
  @authenticator.description = value
end

#error(name, description = nil, options = {}) ⇒ Object



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

def error(name, description = nil, options = {})
  @authenticator.errors[name] = options.merge(:name => name, :description => description)
end

#friendly_name(value) ⇒ Object



9
10
11
# File 'lib/moonrope/dsl/authenticator_dsl.rb', line 9

def friendly_name(value)
  @authenticator.friendly_name = value
end

#header(name, description = nil, options = {}) ⇒ Object



17
18
19
# File 'lib/moonrope/dsl/authenticator_dsl.rb', line 17

def header(name, description = nil, options = {})
  @authenticator.headers[name] = options.merge(:name => name, :description => description)
end

#lookup(&block) ⇒ Object



25
26
27
# File 'lib/moonrope/dsl/authenticator_dsl.rb', line 25

def lookup(&block)
  @authenticator.lookup = block
end

#rule(name, error_code, description = nil, &block) ⇒ Object



29
30
31
# File 'lib/moonrope/dsl/authenticator_dsl.rb', line 29

def rule(name, error_code, description = nil, &block)
  @authenticator.rules[name] = {:name => name, :error_code => error_code, :description => description, :block => block}
end