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/scans.rb,
lib/carddb/resources/exports.rb,
lib/carddb/resources/imports.rb,
lib/carddb/resources/records.rb,
lib/carddb/resources/datasets.rb,
lib/carddb/resources/rulesets.rb,
lib/carddb/resources/publishers.rb,
lib/carddb/resources/import_formats.rb,
lib/carddb/resources/scan_templates.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, DatasetFilterValue, DatasetFilterValueConnection, DatasetImportPreview, DatasetImportPreviewResult, DatasetRecordDeleteJob, DatasetRecordDeleteJobResult, DatasetRecordsUpsertPayload, DatasetSchema, Deck, DeckAPIApplicationAccess, DeckAccessApplication, DeckCollaborator, DeckCopyPayload, DeckDiff, DeckEntriesReplacePayload, DeckEntry, DeckEntryMutationPayload, DeckEntryReorderPayload, DeckExportPayload, DeckHydrateEntriesPayload, DeckImportAmbiguousEntry, DeckImportCandidate, DeckImportEntry, DeckImportFormatDefinition, DeckImportFormatDetection, DeckImportFormatTestPayload, DeckImportIssue, DeckImportPayload, DeckImportUnmatchedEntry, DeckOwnershipTransferPayload, DeckPublishPayload, DeckSectionDefinition, DeckToken, DeckTokenExchangePayload, DeckTokenIssuer, DeckUpsertByExternalRefPayload, DeckValidatedAgainst, DeckValidation, DeckValidationAffectedEntry, DeckValidationIssue, DeckValidationRules, DeckVersion, Error, ExportJob, FieldInfo, FieldMapping, File, FilterBuilder, Game, GameImportDatasetStatus, GameImportJob, GameImportPreview, GameScanRegion, GraphQLError, ImportJob, ImportJobAsset, ImportJobLog, ImportStats, ImportWarning, LinkFieldInfo, MemoryCache, NotFoundError, ObjectField, PageInfo, PresignedUpload, Publisher, RateLimitError, Record, RecordValidationError, ResolvedLink, Resource, RestrictedError, Ruleset, RulesetValidationImpact, RulesetValidationImpactDeck, RulesetVersion, RulesetVersionDraftImportPreview, ScanBestMatch, ScanCandidate, ScanFeatureVersionMetrics, ScanFeedbackMetrics, ScanFeedbackPayload, ScanJob, ScanJobError, ScanJobMetrics, ScanJobPayload, ScanMetrics, ScanStageMetrics, ScanTemplate, ScanTemplatePayload, ScanTemplatePreview, ScanTemplateRegion, ScanTemplateRegionPreview, ScanTemplateResolution, ScanTemplateWarning, ScanWebhookState, ServerError, TimeoutError, ValidationError
Constant Summary collapse
- VERSION =
'0.5.0'
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.
-
.rulesets ⇒ Resources::Rulesets
Access the Rulesets resource via the default client.
-
.scan_templates ⇒ Resources::ScanTemplates
Access the Scan Templates resource via the default client.
-
.scans ⇒ Resources::Scans
Access the Scans resource via the default client.
Class Attribute Details
.configuration ⇒ Configuration
Get the global configuration.
56 57 58 |
# File 'lib/carddb.rb', line 56 def configuration @configuration ||= Configuration.new end |
Class Method Details
.batch {|Batch| ... } ⇒ Array
Execute multiple queries in a single batch request.
213 214 215 |
# File 'lib/carddb.rb', line 213 def batch(&) default_client.batch(&) end |
.configure {|Configuration| ... } ⇒ Configuration
Configure the CardDB client globally.
70 71 72 73 74 75 |
# File 'lib/carddb.rb', line 70 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.
110 111 112 |
# File 'lib/carddb.rb', line 110 def datasets default_client.datasets end |
.decks ⇒ Resources::Decks
Access the Decks resource via the default client.
166 167 168 |
# File 'lib/carddb.rb', line 166 def decks default_client.decks end |
.default_client ⇒ Client
Get the default client instance (uses global configuration).
89 90 91 |
# File 'lib/carddb.rb', line 89 def default_client @default_client ||= Client.new(config: configuration) end |
.exports ⇒ Resources::Exports
Access the Exports resource via the default client.
138 139 140 |
# File 'lib/carddb.rb', line 138 def exports default_client.exports end |
.files ⇒ Resources::Files
Access the Files resource via the default client.
145 146 147 |
# File 'lib/carddb.rb', line 145 def files default_client.files end |
.games ⇒ Resources::Games
Access the Games resource via the default client.
103 104 105 |
# File 'lib/carddb.rb', line 103 def games default_client.games end |
.import_formats ⇒ Resources::ImportFormats
Access the Import Formats resource via the default client.
124 125 126 |
# File 'lib/carddb.rb', line 124 def import_formats default_client.import_formats end |
.imports ⇒ Resources::Imports
Access the Imports resource via the default client.
131 132 133 |
# File 'lib/carddb.rb', line 131 def imports default_client.imports end |
.me ⇒ Hash?
Get information about the current API key.
187 188 189 |
# File 'lib/carddb.rb', line 187 def me default_client.me end |
.publishers ⇒ Resources::Publishers
Access the Publishers resource via the default client.
96 97 98 |
# File 'lib/carddb.rb', line 96 def publishers default_client.publishers end |
.rate_limit_info ⇒ Hash?
Get the last rate limit info from the most recent request.
194 195 196 |
# File 'lib/carddb.rb', line 194 def rate_limit_info Thread.current[:carddb_rate_limit] end |
.records ⇒ Resources::Records
Access the Records resource via the default client.
117 118 119 |
# File 'lib/carddb.rb', line 117 def records default_client.records end |
.reset_configuration! ⇒ Configuration
Reset the global configuration to defaults.
80 81 82 83 84 |
# File 'lib/carddb.rb', line 80 def reset_configuration! @configuration = Configuration.new @default_client = nil configuration end |
.rules ⇒ Resources::Rules
Access the Rules resource via the default client.
173 174 175 |
# File 'lib/carddb.rb', line 173 def rules default_client.rules end |
.rulesets ⇒ Resources::Rulesets
Access the Rulesets resource via the default client.
180 181 182 |
# File 'lib/carddb.rb', line 180 def rulesets default_client.rulesets end |
.scan_templates ⇒ Resources::ScanTemplates
Access the Scan Templates resource via the default client.
159 160 161 |
# File 'lib/carddb.rb', line 159 def scan_templates default_client.scan_templates end |
.scans ⇒ Resources::Scans
Access the Scans resource via the default client.
152 153 154 |
# File 'lib/carddb.rb', line 152 def scans default_client.scans end |