Class: Thanos::StoryDataMapper

Inherits:
Object
  • Object
show all
Includes:
Mappable
Defined in:
lib/thanos/mappers/story_data_mapper.rb

Instance Method Summary collapse

Constructor Details

#initialize(results) ⇒ StoryDataMapper

Returns a new instance of StoryDataMapper.



7
8
9
# File 'lib/thanos/mappers/story_data_mapper.rb', line 7

def initialize(results)
  @results = results
end

Instance Method Details

#mapObject



11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/thanos/mappers/story_data_mapper.rb', line 11

def map
  {
    title: @results['title'],
    description: @results['description'],
    type: @results['type'],
    resource_uri: @results['resourceURI'],
    characters: characters,
    creators: creators,
    events: events,
    series: series,
    comics: comics,
  }
end