Class: Xenon::Headers::IfNoneMatch

Inherits:
ListHeader
  • Object
show all
Defined in:
lib/xenon/headers/if_none_match.rb

Overview

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*etags) ⇒ IfNoneMatch

Returns a new instance of IfNoneMatch.



10
11
12
# File 'lib/xenon/headers/if_none_match.rb', line 10

def initialize(*etags)
  super(etags)
end

Class Method Details

.parse(s) ⇒ Object



20
21
22
23
# File 'lib/xenon/headers/if_none_match.rb', line 20

def self.parse(s)
  tree = Parsers::IfNoneMatchHeader.new.parse(s)
  Parsers::IfNoneMatchHeaderTransform.new.apply(tree)
end

.wildcardObject



16
17
18
# File 'lib/xenon/headers/if_none_match.rb', line 16

def self.wildcard
  new
end

Instance Method Details

#merge(other) ⇒ Object



29
30
31
32
# File 'lib/xenon/headers/if_none_match.rb', line 29

def merge(other)
  raise Xenon::ProtocolError.new('Cannot merge wildcard headers') if wildcard? || other.wildcard?
  super
end

#to_sObject



34
35
36
# File 'lib/xenon/headers/if_none_match.rb', line 34

def to_s
  wildcard? ? '*' : super
end

#wildcard?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/xenon/headers/if_none_match.rb', line 25

def wildcard?
  etags.empty?
end