Sha256: 371dc1b40bb1b8ff23a2421611e766da13dc163316f7ab12cc959bbad541d9be

Contents?: true

Size: 831 Bytes

Versions: 3

Compression:

Stored size: 831 Bytes

Contents

# frozen_string_literal: true

require 'forwardable'

module EveOnline
  module ESI
    class Character < Base
      extend Forwardable

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

      attr_reader :character_id

      def initialize(options)
        super

        @character_id = options.fetch(:character_id)
      end

      def_delegators :model, :as_json, :alliance_id, :ancestry_id, :birthday,
                     :bloodline_id, :corporation_id, :description, :faction_id,
                     :gender, :name, :race_id, :security_status

      def model
        @model ||= Models::Character.new(response)
      end

      def scope; end

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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
eve_online-0.23.0 lib/eve_online/esi/character.rb
eve_online-0.22.0 lib/eve_online/esi/character.rb
eve_online-0.21.0 lib/eve_online/esi/character.rb