Sha256: e2e72474f52eb72d497ba29fa0899468e884cedf51411d794ddb4a983617ff92

Contents?: true

Size: 969 Bytes

Versions: 1

Compression:

Stored size: 969 Bytes

Contents

# frozen_string_literal: true

require 'forwardable'

module EveOnline
  module ESI
    class Corporation < Base
      extend Forwardable

      include ResponseWithEtag

      API_ENDPOINT = 'https://esi.evetech.net/v4/corporations/%<corporation_id>s/?datasource=%<datasource>s'

      attr_reader :corporation_id

      def initialize(options)
        super

        @corporation_id = options.fetch(:corporation_id)
      end

      # TODO: war_eligible
      def_delegators :model, :as_json, :alliance_id, :ceo_id, :creator_id,
                     :date_founded, :description, :faction_id,
                     :home_station_id, :member_count, :name, :shares,
                     :tax_rate, :ticker, :corporation_url, :etag

      def model
        @model ||= Models::Corporation.new(response_with_etag)
      end

      def scope; 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.21.0 lib/eve_online/esi/corporation.rb