Module: Nuggets::URI::ContentTypeMixin
- Included in:
- URI
- Defined in:
- lib/nuggets/uri/content_type_mixin.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#content_type(uri) ⇒ Object
call-seq: URI.content_type(uri) => aString or
nil
.
Class Method Details
.extended(base) ⇒ Object
33 34 35 |
# File 'lib/nuggets/uri/content_type_mixin.rb', line 33 def self.extended(base) base.extend Nuggets::URI::ExistMixin end |
Instance Method Details
#content_type(uri) ⇒ Object
call-seq:
URI.content_type(uri) => aString or +nil+
Return the content type of uri
, or nil
if not found.
41 42 43 |
# File 'lib/nuggets/uri/content_type_mixin.rb', line 41 def content_type(uri) exist?(uri) { |res| res.content_type } end |