igdb2 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +86 -0
  3. data/lib/igdb.rb +91 -0
  4. data/lib/igdb/configuration/api.rb +30 -0
  5. data/lib/igdb/exceptions.rb +13 -0
  6. data/lib/igdb/models/alternative_name.rb +5 -0
  7. data/lib/igdb/models/api_resource.rb +67 -0
  8. data/lib/igdb/models/character.rb +6 -0
  9. data/lib/igdb/models/collection.rb +6 -0
  10. data/lib/igdb/models/company.rb +6 -0
  11. data/lib/igdb/models/credits.rb +6 -0
  12. data/lib/igdb/models/esrb.rb +5 -0
  13. data/lib/igdb/models/external.rb +5 -0
  14. data/lib/igdb/models/feature.rb +5 -0
  15. data/lib/igdb/models/feature_value.rb +5 -0
  16. data/lib/igdb/models/feed.rb +6 -0
  17. data/lib/igdb/models/franchise.rb +6 -0
  18. data/lib/igdb/models/game.rb +6 -0
  19. data/lib/igdb/models/game_engine.rb +6 -0
  20. data/lib/igdb/models/game_mode.rb +6 -0
  21. data/lib/igdb/models/genre.rb +6 -0
  22. data/lib/igdb/models/image.rb +5 -0
  23. data/lib/igdb/models/keyword.rb +6 -0
  24. data/lib/igdb/models/page.rb +6 -0
  25. data/lib/igdb/models/pegi.rb +5 -0
  26. data/lib/igdb/models/person.rb +6 -0
  27. data/lib/igdb/models/platform.rb +6 -0
  28. data/lib/igdb/models/platform_company.rb +5 -0
  29. data/lib/igdb/models/platform_version.rb +5 -0
  30. data/lib/igdb/models/platform_version_release_date.rb +5 -0
  31. data/lib/igdb/models/player_perspective.rb +6 -0
  32. data/lib/igdb/models/pulse.rb +6 -0
  33. data/lib/igdb/models/pulse_group.rb +6 -0
  34. data/lib/igdb/models/pulse_source.rb +6 -0
  35. data/lib/igdb/models/release_date.rb +6 -0
  36. data/lib/igdb/models/review.rb +6 -0
  37. data/lib/igdb/models/theme.rb +6 -0
  38. data/lib/igdb/models/time_to_beat.rb +5 -0
  39. data/lib/igdb/models/title.rb +6 -0
  40. data/lib/igdb/models/version.rb +6 -0
  41. data/lib/igdb/models/video.rb +6 -0
  42. data/lib/igdb/models/website.rb +5 -0
  43. data/lib/igdb/representers/alternative_name_representer.rb +10 -0
  44. data/lib/igdb/representers/character_representer.rb +18 -0
  45. data/lib/igdb/representers/collection_representer.rb +11 -0
  46. data/lib/igdb/representers/company_representer.rb +24 -0
  47. data/lib/igdb/representers/credits_representer.rb +22 -0
  48. data/lib/igdb/representers/esrb_representer.rb +12 -0
  49. data/lib/igdb/representers/external_representer.rb +9 -0
  50. data/lib/igdb/representers/feature_representer.rb +17 -0
  51. data/lib/igdb/representers/feature_value_representer.rb +12 -0
  52. data/lib/igdb/representers/feed_representer.rb +16 -0
  53. data/lib/igdb/representers/franchise_representer.rb +11 -0
  54. data/lib/igdb/representers/game_engine_representer.rb +15 -0
  55. data/lib/igdb/representers/game_mode_representer.rb +11 -0
  56. data/lib/igdb/representers/game_representer.rb +64 -0
  57. data/lib/igdb/representers/genre_representer.rb +10 -0
  58. data/lib/igdb/representers/image_representer.rb +14 -0
  59. data/lib/igdb/representers/keyword_representer.rb +12 -0
  60. data/lib/igdb/representers/page_representer.rb +38 -0
  61. data/lib/igdb/representers/pegi_representer.rb +12 -0
  62. data/lib/igdb/representers/person_representer.rb +15 -0
  63. data/lib/igdb/representers/platform_company_representer.rb +12 -0
  64. data/lib/igdb/representers/platform_representer.rb +17 -0
  65. data/lib/igdb/representers/platform_version_release_date_representer.rb +12 -0
  66. data/lib/igdb/representers/platform_version_representer.rb +32 -0
  67. data/lib/igdb/representers/player_perspective_representer.rb +11 -0
  68. data/lib/igdb/representers/pulse_group_representer.rb +21 -0
  69. data/lib/igdb/representers/pulse_representer.rb +25 -0
  70. data/lib/igdb/representers/pulse_source_representer.rb +15 -0
  71. data/lib/igdb/representers/release_date_representer.rb +21 -0
  72. data/lib/igdb/representers/representer.rb +14 -0
  73. data/lib/igdb/representers/review_representer.rb +28 -0
  74. data/lib/igdb/representers/theme_representer.rb +10 -0
  75. data/lib/igdb/representers/time_to_beat_representer.rb +13 -0
  76. data/lib/igdb/representers/title_representer.rb +13 -0
  77. data/lib/igdb/representers/version_representer.rb +19 -0
  78. data/lib/igdb/representers/video_representer.rb +10 -0
  79. data/lib/igdb/representers/website_representer.rb +12 -0
  80. data/lib/igdb/requester.rb +54 -0
  81. data/lib/igdb/version.rb +3 -0
  82. metadata +278 -0
@@ -0,0 +1,6 @@
1
+ module Igdb
2
+ class Platform < Igdb::ApiResource
3
+ @path = 'platforms'
4
+ @representer = Igdb::PlatformRepresenter
5
+ end
6
+ end
@@ -0,0 +1,5 @@
1
+ module Igdb
2
+ class PlatformCompany < Igdb::ApiResource
3
+ @representer = Igdb::PlatformCompanyRepresenter
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ module Igdb
2
+ class PlatformVersion < Igdb::ApiResource
3
+ @representer = Igdb::PlatformVersionRepresenter
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ module Igdb
2
+ class PlatformVersionReleaseDate < Igdb::ApiResource
3
+ @representer = Igdb::PlatformVersionReleaseDateRepresenter
4
+ end
5
+ end
@@ -0,0 +1,6 @@
1
+ module Igdb
2
+ class PlayerPerspective < Igdb::ApiResource
3
+ @path = 'player_perspectives'
4
+ @representer = Igdb::PlayerPerspectiveRepresenter
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ module Igdb
2
+ class Pulse < Igdb::ApiResource
3
+ @path = 'pulses'
4
+ @representer = Igdb::PulseRepresenter
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ module Igdb
2
+ class PulseGroup < Igdb::ApiResource
3
+ @path = 'pulse_groups'
4
+ @representer = Igdb::PulseGroupRepresenter
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ module Igdb
2
+ class PulseSource < Igdb::ApiResource
3
+ @path = 'pulse_sources'
4
+ @representer = Igdb::PulseSourceRepresenter
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ module Igdb
2
+ class ReleaseDate < Igdb::ApiResource
3
+ @path = 'release_dates'
4
+ @representer = Igdb::ReleaseDateRepresenter
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ module Igdb
2
+ class Review < Igdb::ApiResource
3
+ @path = 'reviews'
4
+ @representer = Igdb::ReviewRepresenter
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ module Igdb
2
+ class Theme < Igdb::ApiResource
3
+ @path = 'themes'
4
+ @representer = Igdb::ThemeRepresenter
5
+ end
6
+ end
@@ -0,0 +1,5 @@
1
+ module Igdb
2
+ class TimeToBeat < Igdb::ApiResource
3
+ @representer = Igdb::TimeToBeatRepresenter
4
+ end
5
+ end
@@ -0,0 +1,6 @@
1
+ module Igdb
2
+ class Title < Igdb::ApiResource
3
+ @path = 'titles'
4
+ @representer = Igdb::TitleRepresenter
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ module Igdb
2
+ class Version < Igdb::ApiResource
3
+ @path = 'game_versions'
4
+ @representer = Igdb::VersionRepresenter
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ module Igdb
2
+ class Video < Igdb::ApiResource
3
+ @path = 'videos'
4
+ @representer = Igdb::VideoRepresenter
5
+ end
6
+ end
@@ -0,0 +1,5 @@
1
+ module Igdb
2
+ class Website < Igdb::ApiResource
3
+ @representer = Igdb::WebsiteRepresenter
4
+ end
5
+ end
@@ -0,0 +1,10 @@
1
+ require 'representable/json'
2
+
3
+ module Igdb
4
+ class AlternativeNameRepresenter < Igdb::Representer
5
+ collection_representer class: Igdb::AlternativeName
6
+
7
+ property :name
8
+ property :comment
9
+ end
10
+ end
@@ -0,0 +1,18 @@
1
+ require 'ostruct'
2
+ require 'representable/json'
3
+
4
+ # URL path: /characters/
5
+ # Video game characters
6
+ module Igdb
7
+ class CharacterRepresenter < Igdb::Representer
8
+ collection_representer class: Igdb::Character
9
+
10
+ property :mug_shot # See the Image object reference.
11
+ property :gender # See the Gender value reference.
12
+ property :species # See the Species value reference.
13
+
14
+ collection :akas # Name aliases - ‘also known as'.
15
+ collection :games # List of games character appears in.
16
+ collection :people # List of people associated with character.
17
+ end
18
+ end
@@ -0,0 +1,11 @@
1
+ require 'representable/json'
2
+
3
+ # URL path: /collections/
4
+ # Collection, AKA Series
5
+ module Igdb
6
+ class CollectionRepresenter < Igdb::Representer
7
+ collection_representer class: Igdb::Collection
8
+
9
+ collection :games
10
+ end
11
+ end
@@ -0,0 +1,24 @@
1
+ require 'ostruct'
2
+ require 'representable/json'
3
+
4
+ # URL path: /companies/
5
+ # Video game companies. Both publishers & developers
6
+ module Igdb
7
+ class CompanyRepresenter < Igdb::Representer
8
+ collection_representer class: Igdb::Company
9
+
10
+ property :logo
11
+ property :description
12
+ property :country
13
+ property :website
14
+ property :start_date
15
+ property :start_date_category
16
+ property :changed_company_id
17
+ property :change_date
18
+ property :change_date_category
19
+ property :twitter # The URL of the Twitter profile
20
+
21
+ collection :published
22
+ collection :developed
23
+ end
24
+ end
@@ -0,0 +1,22 @@
1
+ require 'representable/json'
2
+
3
+ # URL path: /credits/
4
+ # Contains all employees responsible for working on the game.
5
+ module Igdb
6
+ class CreditsRepresenter < Igdb::Representer
7
+ collection_representer class: Igdb::Credits
8
+
9
+ property :game
10
+ property :category
11
+ property :company
12
+ property :position # Position in the credits list.
13
+ property :person
14
+ property :character
15
+ property :person_title
16
+ property :country
17
+ # Credited name of the person only for overriding when misspelled or changed in credits.
18
+ property :credited_name
19
+ # Credited name of the character only for overriding when misspelled or changed in credits.
20
+ property :character_credited_name
21
+ end
22
+ end
@@ -0,0 +1,12 @@
1
+ require 'representable/json'
2
+
3
+ module Igdb
4
+ class EsrbRepresenter < Representable::Decorator
5
+ include Representable::JSON
6
+
7
+ collection_representer class: Igdb::Esrb
8
+
9
+ property :rating # See the ESRB rating value reference
10
+ property :synopsis
11
+ end
12
+ end
@@ -0,0 +1,9 @@
1
+ require 'representable/json'
2
+
3
+ module Igdb
4
+ class ExternalRepresenter < Representable::Decorator
5
+ include Representable::JSON
6
+
7
+ property :steam # The steam id.
8
+ end
9
+ end
@@ -0,0 +1,17 @@
1
+ require 'representable/json'
2
+
3
+ module Igdb
4
+ class FeatureRepresenter < Representable::Decorator
5
+ include Representable::JSON
6
+
7
+ collection_representer class: Igdb::Feature
8
+
9
+ property :title # Title of the feature
10
+ property :description # Description of the feature
11
+ property :category # Feature category
12
+ property :position # Show at this index
13
+
14
+ collection :values, extend: Igdb::FeatureValueRepresenter,
15
+ class: Igdb::FeatureValue
16
+ end
17
+ end
@@ -0,0 +1,12 @@
1
+ require 'representable/json'
2
+
3
+ module Igdb
4
+ class FeatureValueRepresenter < Representable::Decorator
5
+ include Representable::JSON
6
+
7
+ collection_representer class: Igdb::Feature
8
+
9
+ property :game # ID of the Edition
10
+ property :value # Feature's value
11
+ end
12
+ end
@@ -0,0 +1,16 @@
1
+ require 'representable/json'
2
+
3
+ # URL path: /feeds/
4
+ # Feed items are a social feed of status updates, media and news articles.
5
+ module Igdb
6
+ class FeedRepresenter < Igdb::Representer
7
+ collection_representer class: Igdb::Feed
8
+
9
+ property :content
10
+ property :category
11
+ property :user
12
+ property :games
13
+ property :title
14
+ property :feed_likes_count
15
+ end
16
+ end
@@ -0,0 +1,11 @@
1
+ require 'representable/json'
2
+
3
+ # URL path: /franchises/
4
+ # A list of video game franchises such as Star Wars.
5
+ module Igdb
6
+ class FranchiseRepresenter < Igdb::Representer
7
+ collection_representer class: Igdb::Franchise
8
+
9
+ collection :games
10
+ end
11
+ end
@@ -0,0 +1,15 @@
1
+ require 'representable/json'
2
+
3
+ # URL path: /game_engines/
4
+ # Video game engines such as unreal engine.
5
+ module Igdb
6
+ class GameEngineRepresenter < Igdb::Representer
7
+ collection_representer class: Igdb::GameEngine
8
+
9
+ property :logo
10
+
11
+ collection :games
12
+ collection :companies
13
+ collection :platforms
14
+ end
15
+ end
@@ -0,0 +1,11 @@
1
+ require 'representable/json'
2
+
3
+ # URL path: /game_modes/
4
+ # Single player, Multiplayer etc.
5
+ module Igdb
6
+ class GameModeRepresenter < Igdb::Representer
7
+ collection_representer class: Igdb::GameMode
8
+
9
+ collection :games
10
+ end
11
+ end
@@ -0,0 +1,64 @@
1
+ require 'ostruct'
2
+ require 'representable/hash'
3
+
4
+ # URL path: /games/
5
+ # Video Games!
6
+ module Igdb
7
+ class GameRepresenter < Igdb::Representer
8
+ collection_representer class: Igdb::Game
9
+
10
+ property :summary # Summary of the game.
11
+ property :storyline # Plot of the game.
12
+ property :collection # Collection (aka series) the game belongs to.
13
+ property :franchise # ID of a Franchise record.
14
+ property :hypes # Number of follows a game gets before release.
15
+ property :popularity # A number based on traffic to that game page.
16
+ property :rating # Average user rating.
17
+ property :rating_count # Number of user ratings.
18
+ property :aggregated_rating # Rating based on external critic scores.
19
+ property :aggregated_rating_count # Number of external critic scores.
20
+ property :total_rating # Average rating based on both IGDB user and external critic scores.
21
+ property :total_rating_count # Total number of user and external critic scores.
22
+ property :game # ID of a Game this game is a DLC/expansion of (expandable).
23
+ property :version_parent # ID of a Game this game is an edition of.
24
+ property :category # See the Game category value reference.
25
+ property :first_release_date # Initial release date of the game.
26
+ property :status # Release status, e.g. released, alpha, beta, etc.
27
+
28
+ property :time_to_beat, extend: Igdb::TimeToBeatRepresenter, # See the Time to beat object reference.
29
+ class: Igdb::TimeToBeat
30
+ property :cover, extend: Igdb::ImageRepresenter, # Cover image.
31
+ class: Igdb::Image
32
+ property :esrb, extend: Igdb::EsrbRepresenter, # ESRB rating.
33
+ class: Igdb::Esrb
34
+ property :pegi, extend: Igdb::PegiRepresenter, # PEGI rating.
35
+ class: Igdb::Pegi
36
+ property :external, extend: Igdb::ExternalRepresenter,
37
+ class: Igdb::External
38
+
39
+ collection :developers
40
+ collection :publishers
41
+ collection :game_engines
42
+ collection :player_perspectives
43
+ collection :game_modes
44
+ collection :keywords
45
+ collection :themes
46
+ collection :genres
47
+ collection :screenshots
48
+ collection :tags
49
+ collection :games
50
+ collection :dlcs
51
+ collection :expansions
52
+ collection :standalone_expansions
53
+ collection :bundles
54
+
55
+ collection :release_dates, extend: Igdb::ReleaseDateRepresenter,
56
+ class: Igdb::ReleaseDate
57
+ collection :alternative_names, extend: Igdb::AlternativeNameRepresenter,
58
+ class: Igdb::AlternativeName
59
+ collection :videos, extend: Igdb::VideoRepresenter,
60
+ class: Igdb::Video
61
+ collection :websites, extend: Igdb::WebsiteRepresenter,
62
+ class: Igdb::Website
63
+ end
64
+ end
@@ -0,0 +1,10 @@
1
+ require 'representable/json'
2
+
3
+ # URL path: /genres/
4
+ module Igdb
5
+ class GenreRepresenter < Igdb::Representer
6
+ collection_representer class: Igdb::Genre
7
+
8
+ collection :games
9
+ end
10
+ end
@@ -0,0 +1,14 @@
1
+ require 'representable/json'
2
+
3
+ module Igdb
4
+ class ImageRepresenter < Representable::Decorator
5
+ include Representable::JSON
6
+
7
+ collection_representer class: Igdb::Image
8
+
9
+ property :url # Can be non-IGDB URL
10
+ property :cloudinary_id # Cloudinary slug
11
+ property :width # The image's width in pixels
12
+ property :height # The image's height in pixels
13
+ end
14
+ end
@@ -0,0 +1,12 @@
1
+ # URL path: /keywords/
2
+ require 'representable/json'
3
+
4
+ # URL path: /keywords/
5
+ # Keywords are words or phrases that get tagged to a game such as "world war 2" or "steampunk".
6
+ module Igdb
7
+ class KeywordRepresenter < Igdb::Representer
8
+ collection_representer class: Igdb::Keyword
9
+
10
+ collection :games
11
+ end
12
+ end
@@ -0,0 +1,38 @@
1
+ require 'representable/json'
2
+
3
+ # URL path: /pages/
4
+ # Our multipurpose page system is currently used for youtubers and media organisations.
5
+ module Igdb
6
+ class PageRepresenter < Igdb::Representer
7
+ collection_representer class: Igdb::Page
8
+
9
+ property :content
10
+ property :category
11
+ property :sub_category
12
+ property :country
13
+ property :color
14
+ property :user
15
+ property :description
16
+ property :page_follows_count
17
+ property :logo
18
+ property :background
19
+ property :facebook
20
+ property :twitter
21
+ property :twitch
22
+ property :instagram
23
+ property :youtube
24
+ property :steam
25
+ property :linkedin
26
+ property :pinterest
27
+ property :soundcloud
28
+ property :google_plus
29
+ property :reddit
30
+ property :battlenet
31
+ property :origin
32
+ property :uplay
33
+ property :discord
34
+
35
+ collection :game
36
+ collection :company
37
+ end
38
+ end