Created
October 8, 2011 10:47
-
-
Save ainame/1272129 to your computer and use it in GitHub Desktop.
1分で分かるjunemaker/twitterでTwitter#userを呼び出すために行ってる継承等
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
module Twitter | |
module Request | |
def get | |
puts "Hello Twitter.user!!" | |
end | |
end | |
end | |
module Twitter | |
class API | |
include Request | |
end | |
end | |
module Twitter | |
class Client < API | |
module User | |
def user() | |
get() | |
end | |
end | |
end | |
end | |
module Twitter | |
class Client | |
include User | |
end | |
end | |
module Twitter | |
class << self | |
def new() | |
Twitter::Client.new | |
end | |
end | |
end | |
a = Twitter.new | |
a.user #=> Hello Twitter.user!! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment