Sha256: 703c426afd801db94db92d70753723796b7888f8d7ec538bb058daea71e914ca

Contents?: true

Size: 366 Bytes

Versions: 14

Compression:

Stored size: 366 Bytes

Contents

module InlineSvg
  module IOResource
    def self.===(object)
      object.is_a?(IO) || object.is_a?(StringIO)
    end

    def self.default_for(object)
      case object
      when StringIO then ''
      when IO then 1
      end
    end

    def self.read(object)
      start = object.pos
      str = object.read
      object.seek start
      str
    end
  end
end

Version data entries

14 entries across 14 versions & 2 rubygems

Version Path
inline_svg-1.10.0 lib/inline_svg/io_resource.rb
inline_svg-1.9.0 lib/inline_svg/io_resource.rb
inline_svg-1.8.0 lib/inline_svg/io_resource.rb
rails_mini_profiler-0.2.0 vendor/bundle/ruby/3.0.0/gems/inline_svg-1.7.2/lib/inline_svg/io_resource.rb
inline_svg-1.7.2 lib/inline_svg/io_resource.rb
inline_svg-1.7.1 lib/inline_svg/io_resource.rb
inline_svg-1.7.0 lib/inline_svg/io_resource.rb
inline_svg-1.6.0 lib/inline_svg/io_resource.rb
inline_svg-1.5.2 lib/inline_svg/io_resource.rb
inline_svg-1.5.1 lib/inline_svg/io_resource.rb
inline_svg-1.5.0 lib/inline_svg/io_resource.rb
inline_svg-1.4.0 lib/inline_svg/io_resource.rb
inline_svg-1.3.1 lib/inline_svg/io_resource.rb
inline_svg-1.3.0 lib/inline_svg/io_resource.rb