Skip to content

Instantly share code, notes, and snippets.

@tubbo
Created October 20, 2015 16:25
Show Gist options
  • Save tubbo/298d6558592ca9bdc984 to your computer and use it in GitHub Desktop.
Save tubbo/298d6558592ca9bdc984 to your computer and use it in GitHub Desktop.
irb(main):002:0> module Foo; def const_missing(constant); puts "nope: #{constant}"; end; end;
irb(main):003:0* Foo::BAR
NameError: uninitialized constant Foo::BAR
from (irb):3
from /Users/tscott/.rubies/ruby-2.2.2/bin/irb:11:in `<main>'
irb(main):004:0> module Foo; def self.const_missing(constant); puts "nope: #{constant}"; end; end;
irb(main):005:0* Foo::BAR
nope: BAR
=> nil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment