Sha256: 295a76d2a64c4908cbdca3be2ac9a9fce2e325654fb96ae81f8ae437e26b9848

Contents?: true

Size: 960 Bytes

Versions: 6

Compression:

Stored size: 960 Bytes

Contents

# frozen_string_literal: true

module EveOnline
  module ESI
    class CharacterAssetsLocations < Base
      API_PATH = "/v2/characters/%<character_id>s/assets/locations/"

      attr_reader :character_id, :item_ids

      def initialize(options)
        super

        @character_id = options.fetch(:character_id)
        @item_ids = options.fetch(:item_ids)
      end

      def assets_locations
        @assets_locations ||=
          begin
            output = []
            response.each do |asset_location|
              output << Models::AssetLocation.new(asset_location)
            end
            output
          end
      end

      def http_method
        :post
      end

      def payload
        item_ids.to_json
      end

      def scope
        "esi-assets.read_assets.v1"
      end

      def etag
        raise NotImplementedError
      end

      def path
        format(API_PATH, character_id: character_id)
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
eve_online-0.43.0 lib/eve_online/esi/character_assets_locations.rb
eve_online-0.42.0 lib/eve_online/esi/character_assets_locations.rb
eve_online-0.41.0 lib/eve_online/esi/character_assets_locations.rb
eve_online-0.40.0 lib/eve_online/esi/character_assets_locations.rb
eve_online-0.39.0 lib/eve_online/esi/character_assets_locations.rb
eve_online-0.38.0 lib/eve_online/esi/character_assets_locations.rb