module Hermod::Sanitisation

Private Instance Methods

sanitise_attribute(value) click to toggle source

Private: alters attributes so a true becomes “yes”, a no isn't sent and anything else gets turned into a String.

value - the non-sanitised value

Returns the sanitised value of the attribute ready for sending to HMRC.

# File lib/hermod/sanitisation.rb, line 15
def sanitise_attribute(value)
  case value
  when true
    XmlSectionBuilder::YES
  when false
    nil # Attributes aren't included if they're false
  else
    value.to_s
  end
end