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.
-
#table_name ⇒ Object
Returns the value of attribute table_name.
-
#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.
22 23 24 |
# File 'lib/ardb/record_spy.rb', line 22 def associations @associations end |
#callbacks ⇒ Object (readonly)
Returns the value of attribute callbacks.
22 23 24 |
# File 'lib/ardb/record_spy.rb', line 22 def callbacks @callbacks end |
#table_name ⇒ Object
Returns the value of attribute table_name.
21 22 23 |
# File 'lib/ardb/record_spy.rb', line 21 def table_name @table_name end |
#validations ⇒ Object (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 |