Last active
November 23, 2015 09:13
-
-
Save sriharshaj/43c84b91a0fa1e86ed55 to your computer and use it in GitHub Desktop.
Require modules and inheriting modules class Boy
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
require './person.rb' | |
class Greeter < Person::Boy | |
PERSON_TYPE ="make it" | |
def initialize (name) | |
super(name) | |
end | |
def say_hi | |
puts "Hii #{@name}" | |
end | |
def say_bye | |
puts "Bye #{@name}" | |
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
module Person | |
PERSON_TYPE ="make it" | |
def say_hi | |
puts "Hey hii" | |
end | |
def say_bye | |
puts "Bye" | |
end | |
class Boy | |
def initialize (name) | |
@name =name | |
@sex ='M' | |
end | |
def name | |
@name | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment