Class: HttpObjects::Parameters::EntityTags
- Inherits:
-
BasicRules::Base
- Object
- BasicRules::Base
- HttpObjects::Parameters::EntityTags
- Defined in:
- lib/http_objects/parameters/entity_tags.rb
Overview
3.11 Entity Tags
Examples
"123456789" -- A strong ETag validator
W/"123456789" -- A weak ETag validator
Instance Attribute Summary
Attributes inherited from BasicRules::Base
Class Method Summary collapse
Instance Method Summary collapse
-
#weak? ⇒ Boolean
Returns true if raw start with ‘W/’.
Methods inherited from BasicRules::Base
Constructor Details
This class inherits a constructor from HttpObjects::Parameters::BasicRules::Base
Class Method Details
.parse(value) ⇒ Object
10 11 12 13 14 15 16 17 18 |
# File 'lib/http_objects/parameters/entity_tags.rb', line 10 def self.parse(value) raw = value if (match = value.match(/("\w*")/)) value = match[1] else value = "" end self.new(raw, value.to_s) end |
Instance Method Details
#weak? ⇒ Boolean
Returns true if raw start with ‘W/’
21 22 23 |
# File 'lib/http_objects/parameters/entity_tags.rb', line 21 def weak? @raw.start_with?("W/") end |