Module: Ardb::RecordSpy::ClassMethods

Defined in:
lib/ardb/record_spy.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#associationsObject (readonly)

Returns the value of attribute associations.



22
23
24
# File 'lib/ardb/record_spy.rb', line 22

def associations
  @associations
end

#callbacksObject (readonly)

Returns the value of attribute callbacks.



22
23
24
# File 'lib/ardb/record_spy.rb', line 22

def callbacks
  @callbacks
end

#table_nameObject

Returns the value of attribute table_name.



21
22
23
# File 'lib/ardb/record_spy.rb', line 21

def table_name
  @table_name
end

#validationsObject (readonly)

Returns the value of attribute validations.



22
23
24
# File 'lib/ardb/record_spy.rb', line 22

def validations
  @validations
end

Instance Method Details

#validate(method_name = nil, &block) ⇒ Object



70
71
72
73
# File 'lib/ardb/record_spy.rb', line 70

def validate(method_name = nil, &block)
  @validations ||= []
  @validations << Validation.new(:custom, method_name, &block)
end

#validates_associated(*args) ⇒ Object



55
56
57
58
# File 'lib/ardb/record_spy.rb', line 55

def validates_associated(*args)
  @validations ||= []
  @validations << Validation.new(:associated, *args)
end

#validates_each(*args, &block) ⇒ Object



65
66
67
68
# File 'lib/ardb/record_spy.rb', line 65

def validates_each(*args, &block)
  @validations ||= []
  @validations << Validation.new(:each, *args, &block)
end

#validates_with(*args) ⇒ Object



60
61
62
63
# File 'lib/ardb/record_spy.rb', line 60

def validates_with(*args)
  @validations ||= []
  @validations << Validation.new(:with, *args)
end