class RecentlyPs4Games::Game
Attributes
detail_url[RW]
developer[RW]
discription[RW]
genre[RW]
id[RW]
publisher[RW]
release_date[RW]
title[RW]
Public Class Methods
all()
click to toggle source
# File lib/recently_ps4_games/game.rb, line 26 def self.all @@all end
find_by_id(id)
click to toggle source
# File lib/recently_ps4_games/game.rb, line 14 def self.find_by_id(id) self.all.detect do |game| game.id == id end end
new(game_hash)
click to toggle source
# File lib/recently_ps4_games/game.rb, line 6 def initialize(game_hash) game_hash.each do |k, v| self.send("#{k}=", v) end @id = (@@all.size + 1) @@all << self end
Public Instance Methods
add_attributes(details_hash)
click to toggle source
# File lib/recently_ps4_games/game.rb, line 20 def add_attributes(details_hash) details_hash.each do |k, v| self.send("#{k}=", v) end end