class Nfe::Operations::NfeSituation

Public Class Methods

new(certificate, private_key, environment, nfe_key, use_schema: true) click to toggle source
Calls superclass method Nfe::Operations::Base::new
# File lib/nfe/operations/nfe_situation.rb, line 6
def initialize(certificate, private_key, environment, nfe_key,
  use_schema: true)
  super(certificate, private_key, use_schema: use_schema)

  @nfe_key = nfe_key
  @environment = environment
end

Protected Instance Methods

before_execute() click to toggle source
# File lib/nfe/operations/nfe_situation.rb, line 15
def before_execute
  @object = object_to_send
end
handle_result(xml) click to toggle source
# File lib/nfe/operations/nfe_situation.rb, line 19
def handle_result(xml)
  @result = Services::Regress::RetConsSitNFe.new xml
end
schema_name() click to toggle source
# File lib/nfe/operations/nfe_situation.rb, line 27
def schema_name
  ws_info.schema
end
ws_info() click to toggle source
# File lib/nfe/operations/nfe_situation.rb, line 31
def ws_info
  Webservices::Wsinfo::NfeSituation.new(@environment, uf)
end
xpath() click to toggle source
# File lib/nfe/operations/nfe_situation.rb, line 23
def xpath
  "//ns:retConsSitNFe"
end

Private Instance Methods

object_to_send() click to toggle source
# File lib/nfe/operations/nfe_situation.rb, line 36
def object_to_send
  Services::Dispatch::ConsSitNFe.new(@environment, uf, ws_info.version,
    @nfe_key)
end
uf() click to toggle source
# File lib/nfe/operations/nfe_situation.rb, line 41
def uf
  Helpers::NfeKey.parse(@nfe_key).uf
end