Sha256: d97ebd50e48a5a0f2b96fa4866b27de3d47856103bfd21ccee8a7d7327468ea0

Contents?: true

Size: 758 Bytes

Versions: 3

Compression:

Stored size: 758 Bytes

Contents

# frozen_string_literal: true

require 'forwardable'

module EveOnline
  module ESI
    class CharacterShip < Base
      extend Forwardable

      API_ENDPOINT = 'https://esi.evetech.net/v1/characters/%<character_id>s/ship/?datasource=%<datasource>s'

      attr_reader :character_id

      def initialize(options)
        super

        @character_id = options.fetch(:character_id)
      end

      def_delegators :model, :as_json, :ship_item_id, :ship_name, :ship_type_id

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

      def scope
        'esi-location.read_ship_type.v1'
      end

      def url
        format(API_ENDPOINT, character_id: character_id, datasource: datasource)
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
eve_online-0.20.0 lib/eve_online/esi/character_ship.rb
eve_online-0.19.0 lib/eve_online/esi/character_ship.rb
eve_online-0.18.0 lib/eve_online/esi/character_ship.rb