Skip to content

Instantly share code, notes, and snippets.

@daneb
Created July 21, 2016 11:11
Show Gist options
  • Save daneb/883af89a5846a02a1f0c71df5db3d7d5 to your computer and use it in GitHub Desktop.
Save daneb/883af89a5846a02a1f0c71df5db3d7d5 to your computer and use it in GitHub Desktop.
Jsender Extend vs Include
require 'jsender'
module Hello
extend Jsender
def self.world
self.success('moo')
end
end
require 'jsender'
module Hello
include Jsender
def self.world
success('moo')
end
end
@daneb
Copy link
Author

daneb commented Jul 21, 2016

Why does the extend work, but not the include?
irb(main):022:0> Hello.world
NoMethodError: undefined method `success' for Jsender:Module

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment