Class: Module

Inherits:
Object
  • Object
show all
Defined in:
lib/active_row/class_attribute.rb

Instance Method Summary collapse

Instance Method Details

#redefine_method(method, &block) ⇒ Object



20
21
22
23
# File 'lib/active_row/class_attribute.rb', line 20

def redefine_method(method, &block)
  remove_possible_method(method)
  define_method(method, &block)
end

#remove_possible_method(method) ⇒ Object



14
15
16
17
18
# File 'lib/active_row/class_attribute.rb', line 14

def remove_possible_method(method)
  if method_defined?(method) || private_method_defined?(method)
    undef_method(method)
  end
end