class Facturapi::Services::Responses::Procesar

Attributes

response[R]

Public Class Methods

new(response) click to toggle source
# File lib/facturapi/services/responses/procesar.rb, line 7
def initialize(response)
  @response = Nokogiri::XML(response)
end

Public Instance Methods

error() click to toggle source
# File lib/facturapi/services/responses/procesar.rb, line 15
def error
  response.css('Documento>Error').text
end
fecha() click to toggle source
# File lib/facturapi/services/responses/procesar.rb, line 27
def fecha
  Time.strptime(response.css('Documento>Fecha').text, '%FT%T')
end
folio() click to toggle source
# File lib/facturapi/services/responses/procesar.rb, line 19
def folio
  response.css('Documento>Folio').text.to_i
end
tipo_dte() click to toggle source
# File lib/facturapi/services/responses/procesar.rb, line 23
def tipo_dte
  response.css('Documento>TipoDte').text.to_i
end
valid?() click to toggle source
# File lib/facturapi/services/responses/procesar.rb, line 11
def valid?
  response.css('WSPLANO>Resultado').text == 'True'
end