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.
31 32 33 34 |
# File 'lib/mta_sts/fetcher.rb', line 31 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.
29 30 31 |
# File 'lib/mta_sts/fetcher.rb', line 29 def content_type @content_type end |
Instance Method Details
#text_plain? ⇒ Boolean
36 37 38 |
# File 'lib/mta_sts/fetcher.rb', line 36 def text_plain? content_type.to_s.split(";").first.to_s.strip.casecmp?("text/plain") end |