Class: Nyanko::Unit::Extender::Extension
- Inherits:
-
Module
- Object
- Module
- Nyanko::Unit::Extender::Extension
- Includes:
- ActiveRecordClassMethods
- Defined in:
- lib/nyanko/unit/extender/extension.rb
Instance Method Summary collapse
- #class_methods(&block) ⇒ Object
- #class_methods_module ⇒ Object
-
#initialize(mod, prefix = nil, &block) ⇒ Extension
constructor
A new instance of Extension.
- #instance_methods_module ⇒ Object
Methods included from ActiveRecordClassMethods
Constructor Details
#initialize(mod, prefix = nil, &block) ⇒ Extension
Returns a new instance of Extension.
7 8 9 10 11 12 |
# File 'lib/nyanko/unit/extender/extension.rb', line 7 def initialize(mod, prefix = nil, &block) @mod = mod @prefix = prefix @block = block define_methods_with_prefix(instance_methods_module, &block) end |
Instance Method Details
#class_methods(&block) ⇒ Object
14 15 16 |
# File 'lib/nyanko/unit/extender/extension.rb', line 14 def class_methods(&block) define_methods_with_prefix(class_methods_module, &block) end |
#class_methods_module ⇒ Object
22 23 24 |
# File 'lib/nyanko/unit/extender/extension.rb', line 22 def class_methods_module @class_methods_module ||= Module.new end |
#instance_methods_module ⇒ Object
18 19 20 |
# File 'lib/nyanko/unit/extender/extension.rb', line 18 def instance_methods_module self end |