class Nfe::Operations::CorrectionLetter

Public Class Methods

new(certificate:, private_key:, environment:, nfe_key:, sequential:, date_time:, correction:, use_schema: true) click to toggle source
Calls superclass method
# File lib/nfe/operations/correction_letter.rb, line 6
def initialize(certificate:, private_key:, environment:, nfe_key:,
  sequential:, date_time:, correction:, use_schema: true)

  @event = object_event(correction)

  super(certificate, private_key, environment, nfe_key, sequential,
    date_time, @event, use_schema: use_schema)
end

Public Instance Methods

correction_letter_xml() click to toggle source
# File lib/nfe/operations/correction_letter.rb, line 15
def correction_letter_xml
  event_xml
end

Protected Instance Methods

object_event(correction) click to toggle source
# File lib/nfe/operations/correction_letter.rb, line 20
def object_event(correction)
  event = Services::Dispatch::DetEventoCC.new

  event.xCorrecao = correction

  event
end
valid?() click to toggle source
Calls superclass method
# File lib/nfe/operations/correction_letter.rb, line 28
def valid?
  if @event.xCorrecao.to_s.length < 15
    errors.add(:base, I18n.t("correction_letter.invalid_correction"))
  end

  super
end