Class: Xenon::Headers::Authorization
- Defined in:
- lib/xenon/headers/authorization.rb
Overview
Instance Attribute Summary collapse
-
#credentials ⇒ Object
readonly
Returns the value of attribute credentials.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(credentials) ⇒ Authorization
constructor
A new instance of Authorization.
- #to_s ⇒ Object
Constructor Details
#initialize(credentials) ⇒ Authorization
Returns a new instance of Authorization.
12 13 14 |
# File 'lib/xenon/headers/authorization.rb', line 12 def initialize(credentials) @credentials = credentials end |
Instance Attribute Details
#credentials ⇒ Object (readonly)
Returns the value of attribute credentials.
10 11 12 |
# File 'lib/xenon/headers/authorization.rb', line 10 def credentials @credentials end |
Class Method Details
.parse(s) ⇒ Object
16 17 18 19 20 21 |
# File 'lib/xenon/headers/authorization.rb', line 16 def self.parse(s) tree = Parsers::AuthorizationHeader.new.parse(s) Parsers::AuthorizationHeaderTransform.new.apply(tree) rescue Parslet::ParseFailed raise Xenon::ParseError.new("Invalid Authorization header (#{s}).") end |
Instance Method Details
#to_s ⇒ Object
23 24 25 |
# File 'lib/xenon/headers/authorization.rb', line 23 def to_s @credentials.to_s end |