Class: ApiMapper::HashMapper

Inherits:
Mapper
  • Object
show all
Defined in:
lib/api_mapper/mapper.rb

Direct Known Subclasses

GithubMapper::EmojiMapper

Class Method Summary collapse

Methods inherited from Mapper

attributes, #call, entity, relationship, transformation

Class Method Details

.factoryObject



54
55
56
# File 'lib/api_mapper/mapper.rb', line 54

def self.factory
  t(:map_array, super)
end

.mappingObject



49
50
51
52
# File 'lib/api_mapper/mapper.rb', line 49

def self.mapping
  raise "Only one key, pair allowed" if @attributes.count > 1
  @map = t(:structure, @attributes.first.keys.first, @attributes.first.values.first)
end