Module: Nuggets::URI::ContentTypeMixin

Included in:
URI
Defined in:
lib/nuggets/uri/content_type_mixin.rb

Class Method Summary (collapse)

Instance Method Summary (collapse)

Class Method Details

+ (Object) extended(base)



34
35
36
# File 'lib/nuggets/uri/content_type_mixin.rb', line 34

def self.extended(base)
  base.extend Nuggets::URI::ExistMixin
end

Instance Method Details

- (Object) content_type(uri)

call-seq:

URI.content_type(uri) => aString or +nil+

Return the content type of uri, or nil if not found.



42
43
44
# File 'lib/nuggets/uri/content_type_mixin.rb', line 42

def content_type(uri)
  exist?(uri) { |res| res.content_type }
end