lib/cul-fedora/item.rb in cul-fedora-0.8.2 vs lib/cul-fedora/item.rb in cul-fedora-0.8.3

- old
+ new

@@ -1,16 +1,16 @@ require "open3" module Cul module Fedora class Item + attr_reader :server, :pid include Open3 URI_TO_PID = 'info:fedora/' - def <=>(other) pid <=> other.pid end def pid_escaped @@ -18,11 +18,16 @@ end def initialize(*args) options = args.extract_options! @server = options[:server] || Server.new(options[:server_config]) + @logger = options[:logger] @pid = options[:pid] || options[:uri] || raise(ArgumentError, "requires uri or pid") @pid = @pid.to_s.sub(URI_TO_PID, "") + end + + def logger + @logger ||= Logger.new end def ==(other) self.server == other.server self.pid == other.pid