Skip to content

Instantly share code, notes, and snippets.

@cstump
Created July 5, 2013 18:02

Revisions

  1. Chris Stump created this gist Jul 5, 2013.
    64 changes: 64 additions & 0 deletions gistfile1.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,64 @@
    require 'active_support'

    module TestConcern
    extend ActiveSupport::Concern

    module ClassMethods
    def test_class_method
    puts "I gots class!"
    end
    end

    def test_instance_method
    self.class.test_class_method
    end
    end


    module TestConcern2
    extend ActiveSupport::Concern

    def test_instance_method
    self.class.test_class_method
    end

    module ClassMethods
    def test_class_method
    puts "I gots class!"
    end
    end
    end


    module TestConcern3
    extend ActiveSupport::Concern

    module ClassMethods
    def test_class_method
    puts "I gots class!"
    end
    end

    included do
    def test_instance_method
    self.class.test_class_method
    end
    end
    end


    module TestConcern4
    extend ActiveSupport::Concern

    included do
    def test_instance_method
    self.class.test_class_method
    end
    end

    module ClassMethods
    def test_class_method
    puts "I gots class!"
    end
    end
    end