Class: LatestGames::IOSGame
- Inherits:
-
Object
- Object
- LatestGames::IOSGame
- Defined in:
- lib/latest_games/iosgame.rb
Instance Attribute Summary collapse
-
#also_on ⇒ Object
Returns the value of attribute also_on.
-
#metascore ⇒ Object
Returns the value of attribute metascore.
-
#name ⇒ Object
Returns the value of attribute name.
-
#publisher ⇒ Object
Returns the value of attribute publisher.
-
#release_date ⇒ Object
Returns the value of attribute release_date.
-
#summary ⇒ Object
Returns the value of attribute summary.
-
#url ⇒ Object
Returns the value of attribute url.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(name = nil, url = nil) ⇒ IOSGame
constructor
A new instance of IOSGame.
Constructor Details
#initialize(name = nil, url = nil) ⇒ IOSGame
Returns a new instance of IOSGame.
4 5 6 7 |
# File 'lib/latest_games/iosgame.rb', line 4 def initialize(name = nil, url = nil) @name = name @url = url end |
Instance Attribute Details
#also_on ⇒ Object
Returns the value of attribute also_on.
2 3 4 |
# File 'lib/latest_games/iosgame.rb', line 2 def also_on @also_on end |
#metascore ⇒ Object
Returns the value of attribute metascore.
2 3 4 |
# File 'lib/latest_games/iosgame.rb', line 2 def @metascore end |
#name ⇒ Object
Returns the value of attribute name.
2 3 4 |
# File 'lib/latest_games/iosgame.rb', line 2 def name @name end |
#publisher ⇒ Object
Returns the value of attribute publisher.
2 3 4 |
# File 'lib/latest_games/iosgame.rb', line 2 def publisher @publisher end |
#release_date ⇒ Object
Returns the value of attribute release_date.
2 3 4 |
# File 'lib/latest_games/iosgame.rb', line 2 def release_date @release_date end |
#summary ⇒ Object
Returns the value of attribute summary.
2 3 4 |
# File 'lib/latest_games/iosgame.rb', line 2 def summary @summary end |
#url ⇒ Object
Returns the value of attribute url.
2 3 4 |
# File 'lib/latest_games/iosgame.rb', line 2 def url @url end |
Class Method Details
.all ⇒ Object
9 10 11 |
# File 'lib/latest_games/iosgame.rb', line 9 def self.all @@all ||= scrape_ios_games end |
.find(i) ⇒ Object
13 14 15 |
# File 'lib/latest_games/iosgame.rb', line 13 def self.find(i) self.all[i-1] end |
.find_by_name(name) ⇒ Object
17 18 19 20 21 22 |
# File 'lib/latest_games/iosgame.rb', line 17 def self.find_by_name(name) self.all.detect do |game| game.name.downcase.strip == name.downcase.strip || game.name.split("(").first.strip.downcase == name.downcase.strip end end |