Class: BrDanfe::DanfeLib::NfeLib::Cst

Inherits:
Object
  • Object
show all
Defined in:
lib/br_danfe/danfe_lib/nfe_lib/cst.rb

Class Method Summary collapse

Class Method Details

.to_danfe(xml) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/br_danfe/danfe_lib/nfe_lib/cst.rb', line 5

def self.to_danfe(xml)
  value = origin(xml)

  if csosn?(xml)
    value += xml.css('ICMS/*/CSOSN').text
  elsif cst?(xml)
    value += xml.css('ICMS/*/CST').text
  end

  value
end