Class: HttpSignatures::HeaderList
- Inherits:
-
Object
- Object
- HttpSignatures::HeaderList
- Defined in:
- lib/http_signatures/header_list.rb
Defined Under Namespace
Classes: EmptyHeaderList, IllegalHeader
Constant Summary collapse
- ILLEGAL =
cannot sign the signature headers
["authorization", "signature"]
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(names) ⇒ HeaderList
constructor
A new instance of HeaderList.
- #to_a ⇒ Object
- #to_str ⇒ Object
Constructor Details
#initialize(names) ⇒ HeaderList
Returns a new instance of HeaderList.
11 12 13 14 |
# File 'lib/http_signatures/header_list.rb', line 11 def initialize(names) @names = names.map(&:downcase) validate_names! end |
Class Method Details
.from_string(string) ⇒ Object
7 8 9 |
# File 'lib/http_signatures/header_list.rb', line 7 def self.from_string(string) new(string.split(" ")) end |
Instance Method Details
#to_a ⇒ Object
16 17 18 |
# File 'lib/http_signatures/header_list.rb', line 16 def to_a @names.dup end |
#to_str ⇒ Object
20 21 22 |
# File 'lib/http_signatures/header_list.rb', line 20 def to_str @names.join(" ") end |