class Nfe::Helpers::XmlModel::AttributeText
Public Instance Methods
format()
click to toggle source
# File lib/nfe/helpers/xml_model/attribute_text.rb, line 5 def format @format || "%s" end
Private Instance Methods
add_element(attribute)
click to toggle source
# File lib/nfe/helpers/xml_model/attribute_text.rb, line 11 def add_element(attribute) format % normalize_attribute(attribute) end
normalize_attribute(attribute)
click to toggle source
# File lib/nfe/helpers/xml_model/attribute_text.rb, line 15 def normalize_attribute(attribute) attribute.to_s. gsub(/\n/, " "). gsub(/\r/, " "). gsub(/\s+/, " "). gsub(/&/, "&"). gsub(/</, "<"). gsub(/>/, ">"). gsub(/\"/, """). gsub(/\'/, "'"). gsub(/[(ΓΏ-\uFFFF| )]/, " "). gsub(/ +/, " ") end