Module: Ardb::RecordSpy::ClassMethods
- Defined in:
- lib/ardb/record_spy.rb
Instance Attribute Summary collapse
-
#associations ⇒ Object
readonly
Returns the value of attribute associations.
-
#callbacks ⇒ Object
readonly
Returns the value of attribute callbacks.
-
#validations ⇒ Object
readonly
Returns the value of attribute validations.
Instance Method Summary collapse
- #validate(method_name = nil, &block) ⇒ Object
- #validates_associated(*args) ⇒ Object
- #validates_each(*args, &block) ⇒ Object
- #validates_with(*args) ⇒ Object
Instance Attribute Details
#associations ⇒ Object (readonly)
Returns the value of attribute associations.
21 22 23 |
# File 'lib/ardb/record_spy.rb', line 21 def associations @associations end |
#callbacks ⇒ Object (readonly)
Returns the value of attribute callbacks.
21 22 23 |
# File 'lib/ardb/record_spy.rb', line 21 def callbacks @callbacks end |
#validations ⇒ Object (readonly)
Returns the value of attribute validations.
21 22 23 |
# File 'lib/ardb/record_spy.rb', line 21 def validations @validations end |
Instance Method Details
#validate(method_name = nil, &block) ⇒ Object
69 70 71 72 |
# File 'lib/ardb/record_spy.rb', line 69 def validate(method_name = nil, &block) @validations ||= [] @validations << Validation.new(:custom, method_name, &block) end |
#validates_associated(*args) ⇒ Object
54 55 56 57 |
# File 'lib/ardb/record_spy.rb', line 54 def validates_associated(*args) @validations ||= [] @validations << Validation.new(:associated, *args) end |
#validates_each(*args, &block) ⇒ Object
64 65 66 67 |
# File 'lib/ardb/record_spy.rb', line 64 def validates_each(*args, &block) @validations ||= [] @validations << Validation.new(:each, *args, &block) end |
#validates_with(*args) ⇒ Object
59 60 61 62 |
# File 'lib/ardb/record_spy.rb', line 59 def validates_with(*args) @validations ||= [] @validations << Validation.new(:with, *args) end |