Class: ValidatorIE::StateDF
- Inherits:
-
Object
- Object
- ValidatorIE::StateDF
- Includes:
- ActiveModel::Validations
- Defined in:
- lib/validator_ie/core/state_df.rb
Instance Attribute Summary collapse
-
#number ⇒ Object
Returns the value of attribute number.
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ StateDF
constructor
A new instance of StateDF.
- #number_should_mod11 ⇒ Object
Constructor Details
#initialize(opts = {}) ⇒ StateDF
Returns a new instance of StateDF.
10 11 12 13 14 |
# File 'lib/validator_ie/core/state_df.rb', line 10 def initialize(opts={}) opts.each do |key, value| self.public_send("#{key}=", value) end end |
Instance Attribute Details
#number ⇒ Object
Returns the value of attribute number.
6 7 8 |
# File 'lib/validator_ie/core/state_df.rb', line 6 def number @number end |
Instance Method Details
#number_should_mod11 ⇒ Object
16 17 18 19 20 21 |
# File 'lib/validator_ie/core/state_df.rb', line 16 def number_should_mod11 result1 = number_should_modX(11, 10, 9) result2 = number_should_modX(11, 11, 9) return if result1 && result2 errors.add(:number, 'não é válido para inscrição estadual.') end |