Skip to content

Instantly share code, notes, and snippets.

@dangjlin
Created June 21, 2015 21:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dangjlin/65927034aa837edeef05 to your computer and use it in GitHub Desktop.
Save dangjlin/65927034aa837edeef05 to your computer and use it in GitHub Desktop.
require 'active_support'
module MyConcern
extend ActiveSupport::Concern
def an_instance_method; "an instance method"; end
module ClassMethods
def a_class_method; "a class method"; end
end
end
class MyClass
include MyConcern
end
MyClass.new.an_instance_method # => "an instance method"
MyClass.a_class_method # => "a class method"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment