Created
November 13, 2018 05:08
-
-
Save nikita8/e784c1b597f760a4c1b8be55c57a7306 to your computer and use it in GitHub Desktop.
OOP in ruby
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
# Ruby | |
class Festival | |
def initialize(name, description) | |
@name = name | |
@description = description | |
end | |
def is_dashain? | |
if @name == "Dashain" | |
@description = "Let's fly kites." | |
true | |
else | |
false | |
end | |
end | |
def to_s | |
"#{@name}: #{@description}" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment