Module: CardDB
- Defined in:
- lib/carddb.rb,
lib/carddb/batch.rb,
lib/carddb/cache.rb,
lib/carddb/client.rb,
lib/carddb/errors.rb,
lib/carddb/version.rb,
lib/carddb/collection.rb,
lib/carddb/connection.rb,
lib/carddb/deck_tokens.rb,
lib/carddb/configuration.rb,
lib/carddb/query_builder.rb,
lib/carddb/filter_builder.rb,
lib/carddb/resources/base.rb,
lib/carddb/resources/decks.rb,
lib/carddb/resources/files.rb,
lib/carddb/resources/games.rb,
lib/carddb/resources/rules.rb,
lib/carddb/resources/exports.rb,
lib/carddb/resources/imports.rb,
lib/carddb/resources/records.rb,
lib/carddb/resources/datasets.rb,
lib/carddb/resources/publishers.rb,
lib/carddb/resources/import_formats.rb
Overview
CardDB Ruby client library.
A Ruby client for the CardDB GraphQL API, providing search and fetch operations for card game data.
Defined Under Namespace
Modules: CacheSupport, DeckTokens, FilterOperators, QueryBuilder, Resources Classes: AuthenticationError, Batch, BatchProxy, BulkImportResult, BulkRecordError, Client, Collection, Configuration, Connection, ConnectionError, Dataset, DatasetImportPreview, DatasetImportPreviewResult, DatasetRecordDeleteJob, DatasetRecordDeleteJobResult, DatasetRecordsUpsertPayload, DatasetSchema, Deck, DeckAPIApplicationAccess, DeckAccessApplication, DeckAccessToken, DeckAccessTokenExchangePayload, DeckAccessTokenIssuer, DeckCollaborator, DeckCopyPayload, DeckDiff, DeckEmbedToken, DeckEmbedTokenCreatePayload, DeckEntriesReplacePayload, DeckEntry, DeckEntryMutationPayload, DeckEntryReorderPayload, DeckExportPayload, DeckHydrateEntriesPayload, DeckImportAmbiguousEntry, DeckImportCandidate, DeckImportEntry, DeckImportFormatDefinition, DeckImportFormatDetection, DeckImportFormatTestPayload, DeckImportIssue, DeckImportPayload, DeckImportUnmatchedEntry, DeckOwnershipTransferPayload, DeckPreviewToken, DeckPreviewTokenCreatePayload, DeckPublishPayload, DeckSectionDefinition, DeckSessionToken, DeckSessionTokenExchangePayload, DeckUpsertByExternalRefPayload, DeckValidatedAgainst, DeckValidation, DeckValidationAffectedEntry, DeckValidationIssue, DeckVersion, Error, ExportJob, FieldInfo, FieldMapping, File, FilterBuilder, Game, GameImportDatasetStatus, GameImportJob, GameImportPreview, GraphQLError, ImportJob, ImportJobAsset, ImportJobLog, ImportStats, ImportWarning, LinkFieldInfo, MemoryCache, NotFoundError, ObjectField, PageInfo, PresignedUpload, Publisher, RateLimitError, Record, RecordValidationError, ResolvedLink, Resource, RestrictedError, ServerError, TimeoutError, ValidationError
Constant Summary collapse
- VERSION =
'0.3.15'
Class Attribute Summary collapse
-
.configuration ⇒ Configuration
Get the global configuration.
Class Method Summary collapse
-
.batch {|Batch| ... } ⇒ Array
Execute multiple queries in a single batch request.
-
.configure {|Configuration| ... } ⇒ Configuration
Configure the CardDB client globally.
-
.datasets ⇒ Resources::Datasets
Access the Datasets resource via the default client.
-
.decks ⇒ Resources::Decks
Access the Decks resource via the default client.
-
.default_client ⇒ Client
Get the default client instance (uses global configuration).
-
.exports ⇒ Resources::Exports
Access the Exports resource via the default client.
-
.files ⇒ Resources::Files
Access the Files resource via the default client.
-
.games ⇒ Resources::Games
Access the Games resource via the default client.
-
.import_formats ⇒ Resources::ImportFormats
Access the Import Formats resource via the default client.
-
.imports ⇒ Resources::Imports
Access the Imports resource via the default client.
-
.me ⇒ Hash?
Get information about the current API key.
-
.publishers ⇒ Resources::Publishers
Access the Publishers resource via the default client.
-
.rate_limit_info ⇒ Hash?
Get the last rate limit info from the most recent request.
-
.records ⇒ Resources::Records
Access the Records resource via the default client.
-
.reset_configuration! ⇒ Configuration
Reset the global configuration to defaults.
-
.rules ⇒ Resources::Rules
Access the Rules resource via the default client.
Class Attribute Details
.configuration ⇒ Configuration
Get the global configuration.
53 54 55 |
# File 'lib/carddb.rb', line 53 def configuration @configuration ||= Configuration.new end |
Class Method Details
.batch {|Batch| ... } ⇒ Array
Execute multiple queries in a single batch request.
189 190 191 |
# File 'lib/carddb.rb', line 189 def batch(&) default_client.batch(&) end |
.configure {|Configuration| ... } ⇒ Configuration
Configure the CardDB client globally.
67 68 69 70 71 72 |
# File 'lib/carddb.rb', line 67 def configure # Reset the cached client so it picks up new configuration @default_client = nil yield(configuration) configuration end |
.datasets ⇒ Resources::Datasets
Access the Datasets resource via the default client.
107 108 109 |
# File 'lib/carddb.rb', line 107 def datasets default_client.datasets end |
.decks ⇒ Resources::Decks
Access the Decks resource via the default client.
149 150 151 |
# File 'lib/carddb.rb', line 149 def decks default_client.decks end |
.default_client ⇒ Client
Get the default client instance (uses global configuration).
86 87 88 |
# File 'lib/carddb.rb', line 86 def default_client @default_client ||= Client.new(config: configuration) end |
.exports ⇒ Resources::Exports
Access the Exports resource via the default client.
135 136 137 |
# File 'lib/carddb.rb', line 135 def exports default_client.exports end |
.files ⇒ Resources::Files
Access the Files resource via the default client.
142 143 144 |
# File 'lib/carddb.rb', line 142 def files default_client.files end |
.games ⇒ Resources::Games
Access the Games resource via the default client.
100 101 102 |
# File 'lib/carddb.rb', line 100 def games default_client.games end |
.import_formats ⇒ Resources::ImportFormats
Access the Import Formats resource via the default client.
121 122 123 |
# File 'lib/carddb.rb', line 121 def import_formats default_client.import_formats end |
.imports ⇒ Resources::Imports
Access the Imports resource via the default client.
128 129 130 |
# File 'lib/carddb.rb', line 128 def imports default_client.imports end |
.me ⇒ Hash?
Get information about the current API key.
163 164 165 |
# File 'lib/carddb.rb', line 163 def me default_client.me end |
.publishers ⇒ Resources::Publishers
Access the Publishers resource via the default client.
93 94 95 |
# File 'lib/carddb.rb', line 93 def publishers default_client.publishers end |
.rate_limit_info ⇒ Hash?
Get the last rate limit info from the most recent request.
170 171 172 |
# File 'lib/carddb.rb', line 170 def rate_limit_info Thread.current[:carddb_rate_limit] end |
.records ⇒ Resources::Records
Access the Records resource via the default client.
114 115 116 |
# File 'lib/carddb.rb', line 114 def records default_client.records end |
.reset_configuration! ⇒ Configuration
Reset the global configuration to defaults.
77 78 79 80 81 |
# File 'lib/carddb.rb', line 77 def reset_configuration! @configuration = Configuration.new @default_client = nil configuration end |
.rules ⇒ Resources::Rules
Access the Rules resource via the default client.
156 157 158 |
# File 'lib/carddb.rb', line 156 def rules default_client.rules end |