Class: Drillbit::AcceptHeader
- Inherits:
-
Object
- Object
- Drillbit::AcceptHeader
- Defined in:
- lib/drillbit/accept_header.rb
Instance Attribute Summary collapse
-
#application ⇒ Object
Returns the value of attribute application.
-
#raw_accept_header ⇒ Object
Returns the value of attribute raw_accept_header.
Instance Method Summary collapse
- #content_type ⇒ Object
-
#initialize(application:, header:) ⇒ AcceptHeader
constructor
A new instance of AcceptHeader.
- #invalid? ⇒ Boolean
- #to_s ⇒ Object
- #valid? ⇒ Boolean
- #version ⇒ Object
Constructor Details
#initialize(application:, header:) ⇒ AcceptHeader
Returns a new instance of AcceptHeader.
8 9 10 11 |
# File 'lib/drillbit/accept_header.rb', line 8 def initialize(application:, header:) self.application = application self.raw_accept_header = header || '' end |
Instance Attribute Details
#application ⇒ Object
Returns the value of attribute application.
5 6 7 |
# File 'lib/drillbit/accept_header.rb', line 5 def application @application end |
#raw_accept_header ⇒ Object
Returns the value of attribute raw_accept_header.
5 6 7 |
# File 'lib/drillbit/accept_header.rb', line 5 def raw_accept_header @raw_accept_header end |
Instance Method Details
#content_type ⇒ Object
17 18 19 |
# File 'lib/drillbit/accept_header.rb', line 17 def content_type accept_header_data[1] end |
#invalid? ⇒ Boolean
25 26 27 |
# File 'lib/drillbit/accept_header.rb', line 25 def invalid? accept_header_data.nil? end |
#to_s ⇒ Object
29 30 31 |
# File 'lib/drillbit/accept_header.rb', line 29 def to_s raw_accept_header end |
#valid? ⇒ Boolean
21 22 23 |
# File 'lib/drillbit/accept_header.rb', line 21 def valid? !invalid? end |
#version ⇒ Object
13 14 15 |
# File 'lib/drillbit/accept_header.rb', line 13 def version accept_header_data[2] end |