Class: ValidatorIE::StateES
- Inherits:
-
Object
- Object
- ValidatorIE::StateES
- Includes:
- ActiveModel::Validations
- Defined in:
- lib/validator_ie/core/state_es.rb
Instance Attribute Summary collapse
-
#number ⇒ Object
Returns the value of attribute number.
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ StateES
constructor
A new instance of StateES.
- #number_should_mod11 ⇒ Object
Constructor Details
#initialize(opts = {}) ⇒ StateES
Returns a new instance of StateES.
10 11 12 13 14 |
# File 'lib/validator_ie/core/state_es.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_es.rb', line 6 def number @number end |
Instance Method Details
#number_should_mod11 ⇒ Object
16 17 18 19 20 |
# File 'lib/validator_ie/core/state_es.rb', line 16 def number_should_mod11 result = number_should_modX(11, 7) return if result errors.add(:number, 'não é válido para inscrição estadual.') end |