Class: Shaf::Authenticator::Challenge
- Inherits:
-
Object
- Object
- Shaf::Authenticator::Challenge
- Defined in:
- lib/shaf/authenticator/challenge.rb
Instance Attribute Summary collapse
-
#parameters ⇒ Object
readonly
Returns the value of attribute parameters.
-
#realm ⇒ Object
readonly
Returns the value of attribute realm.
-
#scheme ⇒ Object
readonly
Returns the value of attribute scheme.
Instance Method Summary collapse
-
#initialize(scheme, **parameters, &block) ⇒ Challenge
constructor
A new instance of Challenge.
- #realm?(arg) ⇒ Boolean
- #to_s ⇒ Object
Constructor Details
#initialize(scheme, **parameters, &block) ⇒ Challenge
Returns a new instance of Challenge.
8 9 10 11 12 13 |
# File 'lib/shaf/authenticator/challenge.rb', line 8 def initialize(scheme, **parameters, &block) @scheme = scheme @realm = parameters.delete(:realm)&.to_s @parameters = parameters define_singleton_method(:test, &block) end |
Instance Attribute Details
#parameters ⇒ Object (readonly)
Returns the value of attribute parameters.
6 7 8 |
# File 'lib/shaf/authenticator/challenge.rb', line 6 def parameters @parameters end |
#realm ⇒ Object (readonly)
Returns the value of attribute realm.
6 7 8 |
# File 'lib/shaf/authenticator/challenge.rb', line 6 def realm @realm end |
#scheme ⇒ Object (readonly)
Returns the value of attribute scheme.
6 7 8 |
# File 'lib/shaf/authenticator/challenge.rb', line 6 def scheme @scheme end |
Instance Method Details
#realm?(arg) ⇒ Boolean
19 20 21 |
# File 'lib/shaf/authenticator/challenge.rb', line 19 def realm?(arg) realm&.to_s == arg&.to_s end |
#to_s ⇒ Object
15 16 17 |
# File 'lib/shaf/authenticator/challenge.rb', line 15 def to_s "#{scheme} #{parameter_string}" end |