Sha256: 4cf9a2ca6c2f92d1398b56676f9412d7b7c991f98f4cf24a8b7da6aa71f74aa0
Contents?: true
Size: 384 Bytes
Versions: 1
Compression:
Stored size: 384 Bytes
Contents
class IMGKit class Source def initialize(url_file_or_html) @source = url_file_or_html end def url? @source.is_a?(String) && @source.match(/\Ahttp/) end def file? @source.kind_of?(File) || @source.kind_of?(Tempfile) end def html? !(url? || file?) end def to_s file? ? @source.path : @source end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
img-kit-1.3.9.1 | lib/imgkit/source.rb |