Class: Distillery::Game
- Inherits:
-
Object
- Object
- Distillery::Game
- Defined in:
- lib/distillery/game.rb
Overview
Information about game
Instance Attribute Summary collapse
- #cloneof ⇒ String readonly
- #name ⇒ String readonly
- #releases ⇒ Array<Release> readonly
- #roms ⇒ Array<ROM> readonly
Instance Method Summary collapse
-
#each_rom {|rom| ... } ⇒ self, Enumerator
Iterate over ROMs used be the game.
- #eql?(o) ⇒ Boolean
- #hash ⇒ Integer
-
#initialize(name, *roms, releases: nil, cloneof: nil) ⇒ Game
constructor
Create a new instance of Game.
-
#to_s ⇒ String
String representation.
Constructor Details
#initialize(name, *roms, releases: nil, cloneof: nil) ⇒ Game
Create a new instance of Game.
16 17 18 19 20 21 22 23 |
# File 'lib/distillery/game.rb', line 16 def initialize(name, *roms, releases: nil, cloneof: nil) raise ArgumentError if name.nil? @name = name @roms = roms @releases = releases @cloneof = cloneof end |
Instance Attribute Details
#cloneof ⇒ String (readonly)
53 54 55 |
# File 'lib/distillery/game.rb', line 53 def cloneof @cloneof end |
#name ⇒ String (readonly)
44 45 46 |
# File 'lib/distillery/game.rb', line 44 def name @name end |
#releases ⇒ Array<Release> (readonly)
50 51 52 |
# File 'lib/distillery/game.rb', line 50 def releases @releases end |
Instance Method Details
#each_rom {|rom| ... } ⇒ self, Enumerator
Iterate over ROMs used be the game
62 63 64 65 |
# File 'lib/distillery/game.rb', line 62 def each_rom block_given? ? @roms.each {|r| yield(r) } : @roms.each end |
#eql?(o) ⇒ Boolean
31 32 33 |
# File 'lib/distillery/game.rb', line 31 def eql?(o) @name.eql?(o.name) end |
#hash ⇒ Integer
27 28 29 |
# File 'lib/distillery/game.rb', line 27 def hash @name.hash end |
#to_s ⇒ String
String representation
38 39 40 |
# File 'lib/distillery/game.rb', line 38 def to_s @name end |