Class: Nfe::Models::Signature

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::Model
Defined in:
lib/nfe/models/signature.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

#idObject

Returns the value of attribute id.



6
7
8
# File 'lib/nfe/models/signature.rb', line 6

def id
  @id
end

#valueObject



21
22
23
# File 'lib/nfe/models/signature.rb', line 21

def value
  @value || unsigned
end

Class Method Details

.namespaceObject



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