Skip to content

Instantly share code, notes, and snippets.

@sriharshaj
Last active November 23, 2015 09:13
Show Gist options
  • Save sriharshaj/43c84b91a0fa1e86ed55 to your computer and use it in GitHub Desktop.
Save sriharshaj/43c84b91a0fa1e86ed55 to your computer and use it in GitHub Desktop.
Require modules and inheriting modules class Boy
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
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