Class: Moonrope::DSL::AuthenticatorDSL
- Inherits:
-
Object
- Object
- Moonrope::DSL::AuthenticatorDSL
- Defined in:
- lib/moonrope/dsl/authenticator_dsl.rb
Instance Method Summary collapse
- #description(value) ⇒ Object
- #error(name, description = nil, options = {}) ⇒ Object
- #friendly_name(value) ⇒ Object
- #header(name, description = nil, options = {}) ⇒ Object
-
#initialize(authenticator) ⇒ AuthenticatorDSL
constructor
A new instance of AuthenticatorDSL.
- #lookup(&block) ⇒ Object
- #rule(name, error_code, description = nil, &block) ⇒ Object
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, = {}) @authenticator.errors[name] = .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, = {}) @authenticator.headers[name] = .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 |