Sha256: fddd36b0e9f2ac962f1b3ffe60ce44a13fdd888c1c8a097fc9df1e2740b0c1b1

Contents?: true

Size: 828 Bytes

Versions: 1

Compression:

Stored size: 828 Bytes

Contents

require 'forwardable'

module EveOnline
  module ESI
    class CharacterAttributes < Base
      extend Forwardable

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

      attr_reader :character_id

      def initialize(options)
        super

        @character_id = options[:character_id]
      end

      def_delegators :model, :as_json, :charisma, :intelligence, :memory,
                     :perception, :willpower, :bonus_remaps,
                     :last_remap_date, :accrued_remap_cooldown_date

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

      def scope
        'esi-skills.read_skills.v1'
      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_attributes.rb