class Invoiced::List
Attributes
links[R]
total_count[R]
Public Class Methods
new(link_header, total_count)
click to toggle source
# File lib/invoiced/list.rb, line 6 def initialize(link_header, total_count) @links = parse_link_header(link_header) @total_count = total_count end
Private Instance Methods
parse_link_header(header)
click to toggle source
# File lib/invoiced/list.rb, line 13 def parse_link_header(header) links = Hash.new # Parse each part into a named link header.split(',').each do |part, index| section = part.split(';') url = section[0][/<(.*)>/,1] name = section[1][/rel="(.*)"/,1].to_sym links[name] = url end return links end