Module: Aba::Validations::ClassMethods
- Defined in:
- lib/aba/validations.rb
Instance Method Summary collapse
- #validates_account_number(attribute) ⇒ Object
- #validates_becs(attribute) ⇒ Object
- #validates_bsb(attribute, options = {}) ⇒ Object
- #validates_indicator(attribute) ⇒ Object
- #validates_integer(attribute, signed = true) ⇒ Object
- #validates_length(attribute, length) ⇒ Object
- #validates_max_length(attribute, length) ⇒ Object
- #validates_presence_of(*attributes) ⇒ Object
- #validates_transaction_code(attribute) ⇒ Object
Instance Method Details
#validates_account_number(attribute) ⇒ Object
91 92 93 |
# File 'lib/aba/validations.rb', line 91 def validates_account_number(attribute) add_validation_attribute(attribute, :account_number) end |
#validates_becs(attribute) ⇒ Object
95 96 97 |
# File 'lib/aba/validations.rb', line 95 def validates_becs(attribute) add_validation_attribute(attribute, :becs) end |
#validates_bsb(attribute, options = {}) ⇒ Object
74 75 76 77 |
# File 'lib/aba/validations.rb', line 74 def validates_bsb(attribute, = {}) [:allow_blank] ||= false add_validation_attribute(attribute, :bsb, [:allow_blank]) end |
#validates_indicator(attribute) ⇒ Object
99 100 101 |
# File 'lib/aba/validations.rb', line 99 def validates_indicator(attribute) add_validation_attribute(attribute, :indicator) end |
#validates_integer(attribute, signed = true) ⇒ Object
87 88 89 |
# File 'lib/aba/validations.rb', line 87 def validates_integer(attribute, signed = true) add_validation_attribute(attribute, :integer, signed) end |
#validates_length(attribute, length) ⇒ Object
83 84 85 |
# File 'lib/aba/validations.rb', line 83 def validates_length(attribute, length) add_validation_attribute(attribute, :length, length) end |
#validates_max_length(attribute, length) ⇒ Object
79 80 81 |
# File 'lib/aba/validations.rb', line 79 def validates_max_length(attribute, length) add_validation_attribute(attribute, :max_length, length) end |
#validates_presence_of(*attributes) ⇒ Object
68 69 70 71 72 |
# File 'lib/aba/validations.rb', line 68 def validates_presence_of(*attributes) attributes.each do |a| add_validation_attribute(a, :presence) end end |
#validates_transaction_code(attribute) ⇒ Object
103 104 105 |
# File 'lib/aba/validations.rb', line 103 def validates_transaction_code(attribute) add_validation_attribute(attribute, :transaction_code) end |