Class: ActiveRecord::Events::MethodFactory
- Inherits:
-
Object
- Object
- ActiveRecord::Events::MethodFactory
- Defined in:
- lib/active_record/events/method_factory.rb
Instance Method Summary collapse
- #class_methods ⇒ Object
-
#initialize(event_name, options) ⇒ MethodFactory
constructor
A new instance of MethodFactory.
- #instance_methods ⇒ Object
Constructor Details
#initialize(event_name, options) ⇒ MethodFactory
Returns a new instance of MethodFactory.
6 7 8 9 |
# File 'lib/active_record/events/method_factory.rb', line 6 def initialize(event_name, ) @options = @naming = Naming.new(event_name, ) end |
Instance Method Details
#class_methods ⇒ Object
21 22 23 24 25 26 27 28 29 30 |
# File 'lib/active_record/events/method_factory.rb', line 21 def class_methods Module.new.tap do |module_| define_collective_action_method(module_, naming) unless [:skip_scopes] define_scope_method(module_, naming) define_inverse_scope_method(module_, naming) end end end |
#instance_methods ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/active_record/events/method_factory.rb', line 11 def instance_methods Module.new.tap do |module_| define_predicate_method(module_, naming) define_inverse_predicate_method(module_, naming) define_action_method(module_, naming) define_safe_action_method(module_, naming) end end |