Sha256: 9beb0dd8ce036afac97597ccb10ba43ceafc80db96871b76460655b4d37e2176

Contents?: true

Size: 775 Bytes

Versions: 2

Compression:

Stored size: 775 Bytes

Contents

require 'thanos/mappers/mappable'

module Thanos
  class SeriesDataMapper
    include Thanos::Mappable

    def initialize(results)
      @results = results
    end

    def map
      {
        id: @results['id'],
        title: @results['title'],
        description: @results['description'],
        resource_uri: @results['resourceURI'],
        start_year: @results['startYear'],
        end_year: @results['endYear'],
        rating: @results['rating'],
        type: @results['type'],
        urls: urls,
        thumbnail: thumbnail,
        comics: comics,
        stories: stories,
        events: events,
        creators: creators,
        characters: characters,
        next: next_series.first,
        previous: previous_series.first,
      }
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
thanos-0.6.0 lib/thanos/mappers/series_data_mapper.rb
thanos-0.5.0 lib/thanos/mappers/series_data_mapper.rb