Sha256: b68ccbfd7a16d4b2c40b8f017b1edbe1839c08e5bcf0d3d84fbb2030fea13a96

Contents?: true

Size: 871 Bytes

Versions: 2

Compression:

Stored size: 871 Bytes

Contents

# frozen_string_literal: true

require 'forwardable'

module EveOnline
  module ESI
    class UniverseType < Base
      extend Forwardable

      API_ENDPOINT = 'https://esi.evetech.net/v3/universe/types/%<type_id>s/?datasource=%<datasource>s'

      attr_reader :id

      def initialize(options)
        super

        @id = options.fetch(:id)
      end

      def_delegators :model, :as_json, :capacity, :description, :graphic_id,
                     :group_id, :icon_id, :market_group_id, :mass, :name,
                     :packaged_volume, :portion_size, :published, :radius,
                     :type_id, :volume, :dogma_attributes, :dogma_effects

      def model
        Models::Type.new(response)
      end
      memoize :model

      def scope; end

      def url
        format(API_ENDPOINT, type_id: id, datasource: datasource)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
eve_online-0.20.0 lib/eve_online/esi/universe_type.rb
eve_online-0.19.0 lib/eve_online/esi/universe_type.rb