Created
September 17, 2013 16:46
-
-
Save joseluistorres/6597042 to your computer and use it in GitHub Desktop.
Dependencias fixed
This file contains 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
class Lluvia | |
def initialize(intensidad, granizo) | |
@intensidad = intensidad | |
@granizo = granizo | |
end | |
def empieza_lluvia | |
puts "=============LLUVIA=#{@intensidad}==========" | |
end | |
end | |
class Huracan | |
attr_readers :lluvia | |
def initialize(args) | |
@lat = args[:lat] || 20 | |
@lon = args[:lon] || 30 | |
@mucha_lluvia = args.fetch(:mucha_lluvia, false) | |
@derrumbes = args.fetch(:derrumbes, false) | |
@lluvia = args[:lluvia] | |
end | |
def empezar_desastre | |
lluvia.empieza_lluvia if @mucha_lluvia | |
end | |
end | |
Huracan.new(10,20, true, false, Lluvia.new(100, true)).empezar_desastre |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment