Guest User

Untitled

a guest
Jul 21st, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.20 KB | None | 0 0
  1. module Interface
  2. def self.for(interface)
  3. const_get(interface.to_s.capitalize)
  4. end
  5.  
  6. module Foo
  7.  
  8. end
  9.  
  10. module Bar
  11.  
  12. end
  13. end
  14.  
  15. p Interface.for(:foo)
  16. # => Interface::Foo
Add Comment
Please, Sign In to add comment