Sha256: c27415ec2381c67aa2f4a603d795e5fff431727240a7cf2ed202065c1031cf62

Contents?: true

Size: 384 Bytes

Versions: 13

Compression:

Stored size: 384 Bytes

Contents

class PDFKit
  
  class Source
        
    def initialize(url_file_or_html)
      @source = url_file_or_html
    end
    
    def url?
      @source.is_a?(String) && @source.match(/^http/)
    end
    
    def file?
      @source.kind_of?(File)
    end
    
    def html?
      !(url? || file?)
    end
    
    def to_s
      file? ? @source.path : @source
    end
    
  end
  
end

Version data entries

13 entries across 13 versions & 3 rubygems

Version Path
thelinuxlich-pdfkit-0.4.6 lib/pdfkit/source.rb
pdfkit-0.4.6 lib/pdfkit/source.rb
pdfkit-0.4.5 lib/pdfkit/source.rb
pdfkit-0.4.4 lib/pdfkit/source.rb
pdfkit-0.4.3 lib/pdfkit/source.rb
pdfkit-0.4.2 lib/pdfkit/source.rb
pdfkit-0.4.1 lib/pdfkit/source.rb
pdfkit-0.4.0 lib/pdfkit/source.rb
pdfkit_songrit-0.3.4 lib/pdfkit/source.rb
pdfkit-0.3.3 lib/pdfkit/source.rb
pdfkit-0.3.2 lib/pdfkit/source.rb
pdfkit-0.3.1 lib/pdfkit/source.rb
pdfkit-0.3.0 lib/pdfkit/source.rb