lib/iptcr.rb in iptcr-0.1.0 vs lib/iptcr.rb in iptcr-0.1.1

- old
+ new

@@ -1,14 +1,16 @@ require "iptcr/version" module IPTCR - def self.parse(value, length: nil) + class Malformed < RuntimeError; end + + def self.parse(value, length: nil, **kwargs) if value.is_a? String require "stringio" length ||= value.bytesize - IPTC.new(StringIO.new(value), length: length) + IPTC.new(StringIO.new(value), length: length, **kwargs) else - IPTC.new(value, length: length) + IPTC.new(value, length: length, **kwargs) end end autoload :IPTC, "iptcr/iptc" end