Class: TentClient::LinkHeader

Inherits:
Object
  • Object
show all
Defined in:
lib/tent-client/link_header.rb

Defined Under Namespace

Classes: Link

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(links) ⇒ LinkHeader

Returns a new instance of LinkHeader.



12
13
14
# File 'lib/tent-client/link_header.rb', line 12

def initialize(links)
  @links = Array(links)
end

Instance Attribute Details

Returns the value of attribute links.



6
7
8
# File 'lib/tent-client/link_header.rb', line 6

def links
  @links
end

Class Method Details

.parse(header) ⇒ Object



8
9
10
# File 'lib/tent-client/link_header.rb', line 8

def self.parse(header)
  new header.split(',').map { |l| Link.parse(l) }
end

Instance Method Details

#to_sObject



16
17
18
# File 'lib/tent-client/link_header.rb', line 16

def to_s
  links.map(&:to_s).join(', ')
end