Class: Hydra::RemoteIdentifier::Mapper

Inherits:
Object
  • Object
show all
Defined in:
lib/hydra/remote_identifier/mapper.rb

Overview

The Mapper is responsible for transforming a target, via a Map, into an acceptable format for a Minter

Defined Under Namespace

Classes: Map, Wrapper

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(service_class, map_builder = Map, &mapping_block) ⇒ Mapper

Returns a new instance of Mapper.



11
12
13
# File 'lib/hydra/remote_identifier/mapper.rb', line 11

def initialize(service_class, map_builder = Map, &mapping_block)
  @map = map_builder.new(service_class, &mapping_block)
end

Instance Attribute Details

#mapObject (readonly)

Returns the value of attribute map.



10
11
12
# File 'lib/hydra/remote_identifier/mapper.rb', line 10

def map
  @map
end

Instance Method Details

#call(target, wrapper_builder = Wrapper) ⇒ Object



15
16
17
# File 'lib/hydra/remote_identifier/mapper.rb', line 15

def call(target, wrapper_builder = Wrapper)
  wrapper_builder.new(map, target)
end