Sha256: c42f4a3f93d87a1b02662eb5c2ff0e00cbc24ade5fe3098844affc7fbabd4526

Contents?: true

Size: 837 Bytes

Versions: 2

Compression:

Stored size: 837 Bytes

Contents

# frozen_string_literal: true

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

      attr_reader :corporation_id, :page

      def initialize(options)
        super

        @corporation_id = options.fetch(:corporation_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-corporations.read_blueprints.v1'
      end

      def url
        format(API_ENDPOINT, corporation_id: corporation_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/corporation_blueprints.rb
eve_online-0.19.0 lib/eve_online/esi/corporation_blueprints.rb