Sha256: 952ef4e5a42b047e999f5cfcf67c7d1dc9bd1f54c7b58697603167b2d2873892

Contents?: true

Size: 872 Bytes

Versions: 3

Compression:

Stored size: 872 Bytes

Contents

# frozen_string_literal: true

module EveOnline
  module ESI
    class CharacterAssetsNames < Base
      API_PATH = "/v1/characters/%<character_id>s/assets/names/"

      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_names
        @assets_names ||=
          begin
            output = []
            response.each do |asset_name|
              output << Models::AssetName.new(asset_name)
            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 path
        format(API_PATH, character_id: character_id)
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
eve_online-0.46.0 lib/eve_online/esi/character_assets_names.rb
eve_online-0.45.0 lib/eve_online/esi/character_assets_names.rb
eve_online-0.44.0 lib/eve_online/esi/character_assets_names.rb