Class: MtaSts::Fetcher::Body
- Inherits:
-
String
- Object
- String
- MtaSts::Fetcher::Body
- Defined in:
- lib/mta_sts/fetcher.rb
Overview
RFC 8461 §3.2 SHOULD text/plain — reported, not enforced
Instance Attribute Summary collapse
-
#content_type ⇒ Object
readonly
Returns the value of attribute content_type.
Instance Method Summary collapse
-
#initialize(body, content_type: nil) ⇒ Body
constructor
A new instance of Body.
- #text_plain? ⇒ Boolean
Constructor Details
#initialize(body, content_type: nil) ⇒ Body
Returns a new instance of Body.
27 28 29 30 |
# File 'lib/mta_sts/fetcher.rb', line 27 def initialize(body, content_type: nil) super(body) @content_type = content_type end |
Instance Attribute Details
#content_type ⇒ Object (readonly)
Returns the value of attribute content_type.
25 26 27 |
# File 'lib/mta_sts/fetcher.rb', line 25 def content_type @content_type end |
Instance Method Details
#text_plain? ⇒ Boolean
32 33 34 |
# File 'lib/mta_sts/fetcher.rb', line 32 def text_plain? content_type.to_s.split(";").first.to_s.strip.casecmp?("text/plain") end |