Sha256: 2024e84256306e08199a8f26c31d0bd65f2583a43cba9fa7fdc6deabf657fc8b

Contents?: true

Size: 823 Bytes

Versions: 2

Compression:

Stored size: 823 Bytes

Contents

# frozen_string_literal: true

module EveOnline
  module ESI
    class CharacterBookmarks < Base
      API_PATH = "/v2/characters/%<character_id>s/bookmarks/"

      attr_reader :character_id, :page

      def initialize(options)
        super

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

      def bookmarks
        @bookmarks ||=
          begin
            output = []
            response.each do |bookmark|
              output << Models::Bookmark.new(bookmark)
            end
            output
          end
      end

      def scope
        "esi-bookmarks.read_character_bookmarks.v1"
      end

      def additional_query_params
        [:page]
      end

      def path
        format(API_PATH, character_id: character_id)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
eve_online-0.31.0 lib/eve_online/esi/character_bookmarks.rb
eve_online-0.30.0 lib/eve_online/esi/character_bookmarks.rb