Sha256: f05ea4b2a642f7424cd6d0e4f804b081990e8b0e3849de4bef0981f93ada9469

Contents?: true

Size: 687 Bytes

Versions: 4

Compression:

Stored size: 687 Bytes

Contents

# frozen_string_literal: true

require 'forwardable'

module EveOnline
  module ESI
    class UniversePlanet < Base
      extend Forwardable

      API_ENDPOINT = 'https://esi.evetech.net/v1/universe/planets/%<planet_id>s/?datasource=%<datasource>s'

      attr_reader :id

      def initialize(options = {})
        super

        @id = options.fetch(:id)
      end

      def_delegators :model, :as_json, :name, :planet_id, :system_id,
                     :type_id, :position

      def model
        @model ||= Models::Planet.new(response)
      end

      def scope; end

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

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
eve_online-0.23.0 lib/eve_online/esi/universe_planet.rb
eve_online-0.22.0 lib/eve_online/esi/universe_planet.rb
eve_online-0.21.0 lib/eve_online/esi/universe_planet.rb
eve_online-0.20.0 lib/eve_online/esi/universe_planet.rb