Sha256: 62a2b2406a7e5f0ef54e612dfae321a80158dd4462cc8d84e6b9b24540bdf4e1

Contents?: true

Size: 871 Bytes

Versions: 2

Compression:

Stored size: 871 Bytes

Contents

# frozen_string_literal: true

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

      attr_reader :character_id, :page

      def initialize(options)
        super

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

      def bookmark_folders
        @bookmark_folders ||=
          begin
            output = []
            response.each do |bookmark_folder|
              output << Models::BookmarkFolder.new(bookmark_folder)
            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_bookmark_folders.rb
eve_online-0.30.0 lib/eve_online/esi/character_bookmark_folders.rb