Sha256: b92bc16a19910dc996a4d39b9b0a9a842dd9472146ac9e7d803344736f9bf56c

Contents?: true

Size: 868 Bytes

Versions: 2

Compression:

Stored size: 868 Bytes

Contents

# frozen_string_literal: true

module EveOnline
  module ESI
    class CharacterBookmarkFolders < Base
      API_ENDPOINT = 'https://esi.evetech.net/v2/characters/%<character_id>s/bookmarks/folders/?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 bookmark_folders
        output = []
        response.each do |bookmark_folder|
          output << Models::BookmarkFolder.new(bookmark_folder)
        end
        output
      end
      memoize :bookmark_folders

      def scope
        'esi-bookmarks.read_character_bookmarks.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_bookmark_folders.rb
eve_online-0.19.0 lib/eve_online/esi/character_bookmark_folders.rb