Class: CardDB::Resources::Rules
- Defined in:
- lib/carddb/resources/rules.rb
Overview
Rules resource for listing game rules and deck formats.
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#datasets(publisher_slug: nil, game_key: nil, search: nil, first: nil, after: nil) ⇒ Collection<Dataset>
List rule-related datasets for a game.
-
#formats(dataset_key: 'formats', **options, &block) ⇒ Collection<Record>
List deck/game formats from the game’s formats dataset.
-
#list(dataset_key: 'rules', **options, &block) ⇒ Collection<Record>
List rules from the game’s rules dataset.
Methods inherited from Base
Constructor Details
This class inherits a constructor from CardDB::Resources::Base
Instance Method Details
#datasets(publisher_slug: nil, game_key: nil, search: nil, first: nil, after: nil) ⇒ Collection<Dataset>
List rule-related datasets for a game.
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/carddb/resources/rules.rb', line 15 def datasets(publisher_slug: nil, game_key: nil, search: nil, first: nil, after: nil) client.datasets.search( publisher_slug: publisher_slug, game_key: game_key, search: search, purpose: 'RULES', first: first, after: after ) end |
#formats(dataset_key: 'formats', **options, &block) ⇒ Collection<Record>
List deck/game formats from the game’s formats dataset.
38 39 40 |
# File 'lib/carddb/resources/rules.rb', line 38 def formats(dataset_key: 'formats', **, &block) search_records(dataset_key: dataset_key, **, &block) end |
#list(dataset_key: 'rules', **options, &block) ⇒ Collection<Record>
List rules from the game’s rules dataset.
30 31 32 |
# File 'lib/carddb/resources/rules.rb', line 30 def list(dataset_key: 'rules', **, &block) search_records(dataset_key: dataset_key, **, &block) end |