Sha256: 364066282e7d8b0f8718b34232b2b872904cfa2b8ba288eb660cd2d84b12170b

Contents?: true

Size: 883 Bytes

Versions: 2

Compression:

Stored size: 883 Bytes

Contents

# frozen_string_literal: true

module EveOnline
  module ESI
    class CharacterWalletJournal < Base
      API_ENDPOINT = 'https://esi.evetech.net/v4/characters/%<character_id>s/wallet/journal/?datasource=%<datasource>s&page=%<page>s'

      attr_reader :character_id, :page

      def initialize(options)
        super

        @character_id = options.fetch(:character_id)
        @page = options.fetch(:page, 1)
      end

      def wallet_journal_entries
        output = []
        response.each do |wallet_journal_entry|
          output << Models::WalletJournalEntry.new(wallet_journal_entry)
        end
        output
      end
      memoize :wallet_journal_entries

      def scope
        'esi-wallet.read_character_wallet.v1'
      end

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
eve_online-0.20.0 lib/eve_online/esi/character_wallet_journal.rb
eve_online-0.19.0 lib/eve_online/esi/character_wallet_journal.rb