Sha256: 86d88417926163e716e5bbf8b3fb8140f2fb47af3aa17ffcf1f3bba7391007a4

Contents?: true

Size: 485 Bytes

Versions: 4

Compression:

Stored size: 485 Bytes

Contents

require 'memoist'

module EveOnline
  class CharacterImplants
    extend Memoist

    attr_reader :result

    def initialize(result)
      @result = result
    end

    def implants
      output = []
      rowset.each do |implant|
        output << Implant.new(implant)
      end
      output
    end
    memoize :implants

    private

    def rowset
      result.fetch('rowset').reject { |a| a.fetch('@name') != 'implants' }.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_implants.rb
eve_online-0.11.0 lib/eve_online/character_implants.rb
eve_online-0.10.0 lib/eve_online/character_implants.rb
eve_online-0.9.0 lib/eve_online/character_implants.rb