class Bookbinder::Ingest::WorkingCopy

Attributes

full_name[R]
ref[R]

Public Class Methods

new(copied_to: nil, full_name: nil, ref: nil) click to toggle source
# File lib/bookbinder/ingest/working_copy.rb, line 8
def initialize(copied_to: nil,
               full_name: nil,
               ref: nil)
  if [copied_to, full_name].none?
    raise Errors::ProgrammerMistake.new("Must provide copied_to and/or full_name to WorkingCopy.new")
  else
    @copied_to = copied_to
    @full_name = full_name
    @ref = ref
  end
end

Public Instance Methods

==(other) click to toggle source
# File lib/bookbinder/ingest/working_copy.rb, line 28
def ==(other)
  [@copied_to, @full_name, @ref] ==
    [other.instance_variable_get(:@copied_to),
     other.instance_variable_get(:@full_name),
     other.instance_variable_get(:@ref)]
end
available?() click to toggle source
# File lib/bookbinder/ingest/working_copy.rb, line 20
def available?
  !! @copied_to
end
path() click to toggle source
# File lib/bookbinder/ingest/working_copy.rb, line 24
def path
  Pathname(@copied_to)
end