Class: Nfe::Operations::Base
- Inherits:
-
Object
- Object
- Nfe::Operations::Base
- Includes:
- ActiveModel::Model
- Defined in:
- lib/nfe/operations/base.rb
Direct Known Subclasses
ConsultEmitter, Event, NfeDiscard, NfeSend, NfeSituation, ServiceStatus
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#result ⇒ Object
readonly
Returns the value of attribute result.
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(certificate, private_key, use_schema: true) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(certificate, private_key, use_schema: true) ⇒ Base
Returns a new instance of Base.
8 9 10 11 12 13 14 |
# File 'lib/nfe/operations/base.rb', line 8 def initialize(certificate, private_key, use_schema: true) @errors = ActiveModel::Errors.new(self) @certificate = certificate @private_key = private_key @use_schema = use_schema validate_certificate end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
6 7 8 |
# File 'lib/nfe/operations/base.rb', line 6 def errors @errors end |
#result ⇒ Object (readonly)
Returns the value of attribute result.
6 7 8 |
# File 'lib/nfe/operations/base.rb', line 6 def result @result end |
Instance Method Details
#execute ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'lib/nfe/operations/base.rb', line 16 def execute if errors.empty? before_execute call_webservice if valid? end errors.empty? end |