Class: HttpSignatures::HeaderList

Inherits:
Object
  • Object
show all
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

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_aObject



16
17
18
# File 'lib/http_signatures/header_list.rb', line 16

def to_a
  @names.dup
end

#to_strObject



20
21
22
# File 'lib/http_signatures/header_list.rb', line 20

def to_str
  @names.join(" ")
end