Class: Thanos::EventDataMapper

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

Instance Method Summary collapse

Constructor Details

#initialize(results) ⇒ EventDataMapper

Returns a new instance of EventDataMapper.



7
8
9
# File 'lib/thanos/mappers/event_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
24
25
26
27
28
29
# File 'lib/thanos/mappers/event_data_mapper.rb', line 11

def map
  {
    id: @results['id'],
    title: @results['title'],
    description: @results['description'],
    resource_uri: @results['resourceURI'],
    start: start_date,
    end: end_date,
    urls: urls,
    thumbnail: thumbnail,
    creators: creators,
    characters: characters,
    series: series,
    stories: stories,
    comics: comics,
    next: next_event,
    previous: previous_event,
  }
end