Class: FedoraMigrate::TargetConstructor

Inherits:
Object
  • Object
show all
Defined in:
lib/fedora_migrate/target_constructor.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(source) ⇒ TargetConstructor

Returns a new instance of TargetConstructor.



5
6
7
# File 'lib/fedora_migrate/target_constructor.rb', line 5

def initialize(source)
  @source = source
end

Instance Attribute Details

#candidates=(value) ⇒ Object

Sets the attribute candidates

Parameters:

  • value

    the value to set the attribute candidates to.



3
4
5
# File 'lib/fedora_migrate/target_constructor.rb', line 3

def candidates=(value)
  @candidates = value
end

#sourceObject

Returns the value of attribute source.



3
4
5
# File 'lib/fedora_migrate/target_constructor.rb', line 3

def source
  @source
end

#targetObject

Returns the value of attribute target.



3
4
5
# File 'lib/fedora_migrate/target_constructor.rb', line 3

def target
  @target
end

Instance Method Details

#buildObject



9
10
11
12
# File 'lib/fedora_migrate/target_constructor.rb', line 9

def build
  raise FedoraMigrate::Errors::MigrationError, "No qualified targets found in #{source.pid}" if target.nil?
  target.new(id: FedoraMigrate::Mover.id_component(source))
end