Sha256: ab8d068efb4a9b32ada79c60e28dccb37121d61242252c150f8078394d62bc02

Contents?: true

Size: 784 Bytes

Versions: 1

Compression:

Stored size: 784 Bytes

Contents

require 'forwardable'

module EveOnline
  module ESI
    class Character < Base
      extend Forwardable

      API_ENDPOINT = 'https://esi.tech.ccp.is/v4/characters/%<character_id>s/?datasource=tranquility'.freeze

      attr_reader :character_id

      def initialize(options)
        super

        @character_id = options[:character_id]
      end

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

      def model
        Models::Character.new(response)
      end
      memoize :model

      def scope; end

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
eve_online-0.14.0 lib/eve_online/esi/character.rb