class SteamUpcoming::Game

The SteamUpcoming::Game class is responsible for creating new Game objects with the information collected from the SteamUpcoming::Scraper class.

Attributes

about[RW]
details[RW]
name[RW]
platforms[RW]
release_date[RW]
tags[RW]
url[RW]

Public Class Methods

new() click to toggle source
# File lib/steam-upcoming/game.rb, line 9
def initialize
  @@all << self
end

Private Class Methods

all() click to toggle source
# File lib/steam-upcoming/game.rb, line 14
def self.all #show all games
  @@all
end
find(id) click to toggle source
# File lib/steam-upcoming/game.rb, line 23
def self.find(id) #find a game based on number
  self.all[id-1]
end
find_by_name(name) click to toggle source
# File lib/steam-upcoming/game.rb, line 27
def self.find_by_name(name) #find a game based on name
  self.all.detect do |game|
    game.name.downcase == name
  end
end
reset() click to toggle source
# File lib/steam-upcoming/game.rb, line 19
def self.reset #clear the list of games
  @@all.clear
end