Class: GameFaqs::Platform
- Inherits:
-
Object
- Object
- GameFaqs::Platform
- Defined in:
- lib/gamefaqs/platform.rb
Instance Attribute Summary collapse
-
#homepage ⇒ Object
readonly
Returns the value of attribute homepage.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Class Method Summary collapse
- .all ⇒ Object
- .all_games ⇒ Object
- .all_ids ⇒ Object
-
.find(platform_name) ⇒ Object
create case insensitive.
Instance Method Summary collapse
- #find(game, refresh = false) ⇒ Object
-
#initialize(params = {}) ⇒ Platform
constructor
A new instance of Platform.
- #to_s ⇒ Object
Constructor Details
#initialize(params = {}) ⇒ Platform
Returns a new instance of Platform.
6 7 8 9 10 11 |
# File 'lib/gamefaqs/platform.rb', line 6 def initialize(params={}) raise ArgumentError("Need at least the name, homepage, and id of the platform!") unless params[:name] && params[:homepage] && params[:id] @name = params[:name] @homepage = "#{GameFaqs::BASE_URL}#{params[:homepage]}" @id = params[:id] if params[:id] end |
Instance Attribute Details
#homepage ⇒ Object (readonly)
Returns the value of attribute homepage.
4 5 6 |
# File 'lib/gamefaqs/platform.rb', line 4 def homepage @homepage end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
4 5 6 |
# File 'lib/gamefaqs/platform.rb', line 4 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/gamefaqs/platform.rb', line 4 def name @name end |
Class Method Details
.all_games ⇒ Object
25 26 27 |
# File 'lib/gamefaqs/platform.rb', line 25 def self.all_games List.games(self) end |
.all_ids ⇒ Object
21 22 23 |
# File 'lib/gamefaqs/platform.rb', line 21 def self.all_ids List.platform_ids end |