Sha256: 8d3a6fb5cde336d7fe67a573fb2edc7a20473fe9614f33334afbb5df7f6e4b5c

Contents?: true

Size: 439 Bytes

Versions: 1

Compression:

Stored size: 439 Bytes

Contents

require "uri"

module CourseraDownloader
  class Document
    attr_reader :url, :content_type
    attr_accessor :body

    def initialize(url, body, content_type)
      @url = url
      @body = body
      @content_type = content_type
    end

    def is_html?
      content_type =~ /text\/html/
    end

    def is_css?
      content_type =~ /text\/css/
    end

    def is_javascript?
      content_type =~ /javascript/
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
coursera_downloader-1.0.0 lib/coursera_downloader/document.rb