Sha256: 79b7c4dfa2d33375d98acdeac9136933cee696fd3d89f88aefb3c3e095b174a4

Contents?: true

Size: 771 Bytes

Versions: 1

Compression:

Stored size: 771 Bytes

Contents

# frozen_string_literal: true

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

      attr_reader :corporation_id

      def initialize(options)
        super

        @corporation_id = options.fetch(:corporation_id)
      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)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
eve_online-0.17.0 lib/eve_online/esi/corporation_blueprints.rb