class HttpLinkHeader::HttpLinkParams::RelationTypes
Public Class Methods
new(relation_types)
click to toggle source
Calls superclass method
# File lib/http_link_header/http_link_params.rb, line 9 def initialize(relation_types) if relation_types.is_a?(Enumerable) super(relation_types) elsif relation_types.is_a?(String) super() add(relation_types) else raise ArgumentError, "invalid relation-types: #{relation_types}" end end
Public Instance Methods
add(relation_types)
click to toggle source
Calls superclass method
# File lib/http_link_header/http_link_params.rb, line 20 def add(relation_types) relation_types.strip.gsub!(/\A"|"\z/, '').split(' ').each do |relation_type| relation_type = relation_type.strip super(relation_type.downcase) unless relation_type.empty? end end
include?(relation_type)
click to toggle source
Calls superclass method
# File lib/http_link_header/http_link_params.rb, line 27 def include?(relation_type) super(relation_type.downcase) end
to_s()
click to toggle source
# File lib/http_link_header/http_link_params.rb, line 31 def to_s %Q{"#{to_a.join(' ')}"} end