Sha256: e1216cfa2f4a16db4da65bce9d41449059bc239a022ab3506718299837732531

Contents?: true

Size: 819 Bytes

Versions: 2

Compression:

Stored size: 819 Bytes

Contents

# frozen_string_literal: true

module EveOnline
  module ESI
    class CharacterBlueprints < Base
      API_ENDPOINT = 'https://esi.evetech.net/v2/characters/%<character_id>s/blueprints/?datasource=%<datasource>s&page=%<page>s'

      attr_reader :character_id, :page

      def initialize(options)
        super

        @character_id = options.fetch(:character_id)
        @page = options.fetch(:page, 1)
      end

      def blueprints
        output = []
        response.each do |blueprint|
          output << Models::Blueprint.new(blueprint)
        end
        output
      end
      memoize :blueprints

      def scope
        'esi-characters.read_blueprints.v1'
      end

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
eve_online-0.20.0 lib/eve_online/esi/character_blueprints.rb
eve_online-0.19.0 lib/eve_online/esi/character_blueprints.rb