Sha256: b90249ea58d014bffd89038eccc0421b6b16429c85f7b9ac0b371c3712091456

Contents?: true

Size: 394 Bytes

Versions: 16

Compression:

Stored size: 394 Bytes

Contents

module ZPNG
  class Metadata < Array
    def initialize img = nil
      return unless img
      img.chunks.each do |c|
        next unless c.is_a?(TextChunk)
        self << [c.keyword, c.text, c.to_hash]
      end
    end

    def [] *args
      if args.first.is_a?(String)
        each{ |a| return a[1] if a[0] == args.first }
        nil
      else
        super
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
zpng-0.4.5 lib/zpng/metadata.rb
zpng-0.4.4 lib/zpng/metadata.rb
zpng-0.4.3 lib/zpng/metadata.rb
zpng-0.4.2 lib/zpng/metadata.rb
zpng-0.4.1 lib/zpng/metadata.rb
zpng-0.4.0 lib/zpng/metadata.rb
zpng-0.3.4 lib/zpng/metadata.rb
zpng-0.3.3 lib/zpng/metadata.rb
zpng-0.3.2 lib/zpng/metadata.rb
zpng-0.3.1 lib/zpng/metadata.rb
zpng-0.3.0 lib/zpng/metadata.rb
zpng-0.2.5 lib/zpng/metadata.rb
zpng-0.2.4 lib/zpng/metadata.rb
zpng-0.2.3 lib/zpng/metadata.rb
zpng-0.2.2 lib/zpng/metadata.rb
zpng-0.2.1 lib/zpng/metadata.rb