This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# recreation_centre.rb | |
module Swimmable | |
def swim | |
"Can swim here!" | |
end | |
end | |
class GreenSpace | |
attr_reader :name, :num_trees |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# greenspace.rb | |
class GreenSpace | |
attr_reader :name, :num_trees | |
def initialize(name, num_trees) | |
@name = name | |
@num_trees = num_trees | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#city_park.rb | |
class CityPark | |
attr_reader :name, :num_trees | |
def initialize(name, num_trees) | |
@name = name | |
@num_trees = num_trees | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SUITS = %w[C H D S] | |
SUITS_HASH = { 'C' => 'Clubs', | |
'H' => 'Hearts', | |
'D' => 'Diamonds', | |
'S' => 'Spades' } | |
DEALER_STOPS_AT = 17 | |
BUST_IF_OVER = 21 | |
def prompt(msg) | |
puts "==> #{msg}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
loop do | |
puts 'This is the outer loop.' | |
loop do | |
puts 'This is the inner loop.' | |
break | |
end | |
break | |
end |
NewerOlder