Sha256: b738ba651fec6f76eb2aa88cca78f2f51aa1dfa549c38d695312a45cd8b05a6b

Contents?: true

Size: 471 Bytes

Versions: 4

Compression:

Stored size: 471 Bytes

Contents

require 'memoist'

module EveOnline
  class CharacterSkills
    extend Memoist

    attr_reader :result

    def initialize(result)
      @result = result
    end

    def skills
      output = []
      rowset.each do |skill|
        output << Skill.new(skill)
      end
      output
    end
    memoize :skills

    private

    def rowset
      result.fetch('rowset').reject { |a| a.fetch('@name') != 'skills' }.first.fetch('row')
    end
    memoize :rowset
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
eve_online-0.12.0 lib/eve_online/character_skills.rb
eve_online-0.11.0 lib/eve_online/character_skills.rb
eve_online-0.10.0 lib/eve_online/character_skills.rb
eve_online-0.9.0 lib/eve_online/character_skills.rb