Sha256: 0f93adfc3e76d0068d3f8e4761692831d227bf2bffc2d46ffc850de47303b8d1

Contents?: true

Size: 805 Bytes

Versions: 2

Compression:

Stored size: 805 Bytes

Contents

module EveOnline
  module ESI
    class CharacterSkills < Base
      API_ENDPOINT = 'https://esi.tech.ccp.is/latest/characters/%s/skills/?datasource=tranquility'.freeze

      attr_reader :character_id

      def initialize(token, character_id)
        super(token)
        @character_id = character_id
      end

      def as_json
        {
          total_sp: total_sp
        }
      end

      def total_sp
        response.fetch('total_sp')
      end

      def skills
        output = []
        response.fetch('skills').each do |skill|
          output << EveOnline::ESI::Models::Skill.new(skill)
        end
        output
      end
      memoize :skills

      def scope
        'esi-skills.read_skills.v1'
      end

      def url
        API_ENDPOINT % character_id
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
eve_online-0.12.0 lib/eve_online/esi/character_skills.rb
eve_online-0.11.0 lib/eve_online/esi/character_skills.rb