Sha256: b28a66e7efc502f623a595c2bfd6928ca0f46480c07dcb81766d38bf60918e46

Contents?: true

Size: 509 Bytes

Versions: 2

Compression:

Stored size: 509 Bytes

Contents

module Thanos
  module Item
    class Comic
      attr_reader :id, :name, :resource_uri, :type

      def initialize(data)
        @id = data['id'].to_i
        @name = data['name']
        @resource_uri = data['resourceURI']
        @type = data['type'] || nil
      end

      def complete
        response = Thanos::API::Response.new(RestClient.get(@resource_uri))
        results = Thanos::ResponseHolder.new(response).results
        Thanos::Factory::Comic.new(results).build
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
thanos-0.6.0 lib/thanos/resources/item/comic.rb
thanos-0.5.0 lib/thanos/resources/item/comic.rb