Class: NfseGyn::Sanitizer
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #clear ⇒ Object
-
#initialize(value) ⇒ Sanitizer
constructor
A new instance of Sanitizer.
Constructor Details
#initialize(value) ⇒ Sanitizer
Returns a new instance of Sanitizer.
5 6 7 |
# File 'lib/nfse_gyn/sanitizer.rb', line 5 def initialize(value) @value = value end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
3 4 5 |
# File 'lib/nfse_gyn/sanitizer.rb', line 3 def value @value end |
Instance Method Details
#clear ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/nfse_gyn/sanitizer.rb', line 9 def clear return nil if value.nil? temp = I18n.transliterate(value) temp.tr!('-', ' ') temp.gsub!(/,|\./, '') temp.scan(/\w+|\s+/i).join end |