Sha256: 9629237e795fbc7e99cb9b6a53fb9c691e2c2ac3c2ec8f837b8e3139f60d2ca3

Contents?: true

Size: 773 Bytes

Versions: 4

Compression:

Stored size: 773 Bytes

Contents

# frozen_string_literal: true

require 'forwardable'

module EveOnline
  module ESI
    class CharacterLocation < Base
      extend Forwardable

      API_PATH = '/v1/characters/%<character_id>s/location/?datasource=%<datasource>s'

      attr_reader :character_id

      def initialize(options)
        super

        @character_id = options.fetch(:character_id)
      end

      def_delegators :model, :as_json, :solar_system_id, :station_id,
                     :structure_id

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

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

      def url
        format("#{ API_HOST }#{ API_PATH }", character_id: character_id, datasource: datasource)
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
eve_online-0.27.0 lib/eve_online/esi/character_location.rb
eve_online-0.26.0 lib/eve_online/esi/character_location.rb
eve_online-0.25.0 lib/eve_online/esi/character_location.rb
eve_online-0.24.0 lib/eve_online/esi/character_location.rb