Class: Troo::API::Headers

Inherits:
Object
  • Object
show all
Defined in:
lib/troo/api/headers.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(uri, headers = {}) ⇒ Troo::API::Headers

Parameters:

  • (String)
  • (Hash)


16
17
18
# File 'lib/troo/api/headers.rb', line 16

def initialize(uri, headers = {})
  @uri, @headers = uri, headers
end

Class Method Details

.build!(uri, headers = {}) ⇒ Hash

Parameters:

  • (String)
  • (Hash)

Returns:

  • (Hash)


8
9
10
# File 'lib/troo/api/headers.rb', line 8

def build!(uri, headers = {})
  new(uri, headers).build!
end

Instance Method Details

#build!Hash

Returns:

  • (Hash)


21
22
23
# File 'lib/troo/api/headers.rb', line 21

def build!
  defaults.merge!(@headers)
end