Created
June 21, 2015 21:10
-
-
Save dangjlin/65927034aa837edeef05 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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