Class: Nfe::Models::Signature
- Inherits:
-
Object
- Object
- Nfe::Models::Signature
- Includes:
- ActiveModel::Model
- Defined in:
- lib/nfe/models/signature.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
- #value ⇒ Object
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(id = nil) ⇒ Signature
constructor
A new instance of Signature.
- #parse!(xml) ⇒ Object
Constructor Details
#initialize(id = nil) ⇒ Signature
Returns a new instance of Signature.
13 14 15 |
# File 'lib/nfe/models/signature.rb', line 13 def initialize(id = nil) @id = id end |
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
6 7 8 |
# File 'lib/nfe/models/signature.rb', line 6 def id @id end |
#value ⇒ Object
21 22 23 |
# File 'lib/nfe/models/signature.rb', line 21 def value @value || unsigned end |
Class Method Details
.namespace ⇒ Object
17 18 19 |
# File 'lib/nfe/models/signature.rb', line 17 def self.namespace "http://www.w3.org/2000/09/xmldsig#" end |
Instance Method Details
#parse!(xml) ⇒ Object
25 26 27 28 |
# File 'lib/nfe/models/signature.rb', line 25 def parse!(xml) doc = Nokogiri::XML(xml) @value = doc.children.present? ? doc.root.children.to_xml : nil end |