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