Skip to content

Instantly share code, notes, and snippets.

@kwstannard
Created October 6, 2015 03:06
Show Gist options
  • Save kwstannard/85378d4b1ae3186a20f2 to your computer and use it in GitHub Desktop.
Save kwstannard/85378d4b1ae3186a20f2 to your computer and use it in GitHub Desktop.
# app/models/user.rb
Dryer.def_class(__FILE__) do
def hi
"hello world"
end
end
User.new.hi
=> "hello world"
# app/models/instruments/horn.rb
Dryer.def_class(__FILE__) do
def play
"toot!"
end
end
Instruments::Horn.new.play
=> "toot!"
# app/models/address.rb
Dryer.def_class(__FILE__, ActiveRecord::Base) do
end
Address.new.respond_to? :save
=> true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment