Last active
December 19, 2015 11:29
-
-
Save poysama/5947716 to your computer and use it in GitHub Desktop.
How do you access a class that is inside a module in another module without specifying its scope?
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
#!/usr/bin/env ruby | |
module AwesomeProject | |
module Models | |
class User | |
def intialize | |
end | |
end | |
end | |
end | |
module AwesomeProject | |
module Workflow | |
# I want to access the User class here as User and not Models::User | |
def self.create_user | |
Models::User.new | |
puts "User created!" | |
end | |
end | |
end | |
AwesomeProject::Workflow.create_user |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment