Skip to content

Instantly share code, notes, and snippets.

@launchkit-codes
Created January 20, 2015 10:02
Show Gist options
  • Select an option

  • Save launchkit-codes/defaf0416629bf839445 to your computer and use it in GitHub Desktop.

Select an option

Save launchkit-codes/defaf0416629bf839445 to your computer and use it in GitHub Desktop.
Return a Class in Ruby
class Hello
def self.world
puts 'Hello World !'
end
end
def return_hello
return Hello
end
return_hello.world
# Output:
#
# $> ruby return_a_class.rb
# Hello World !
# $>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment