Class: Nfe::Information
- Inherits:
-
Object
- Object
- Nfe::Information
- Defined in:
- lib/nfe_reader/information.rb
Instance Attribute Summary collapse
-
#information ⇒ Object
readonly
Returns the value of attribute information.
-
#information_taxpayer ⇒ Object
readonly
Returns the value of attribute information_taxpayer.
-
#messages ⇒ Object
readonly
Returns the value of attribute messages.
-
#references ⇒ Object
readonly
Returns the value of attribute references.
-
#taxpayer_messages ⇒ Object
readonly
Returns the value of attribute taxpayer_messages.
Instance Method Summary collapse
-
#initialize(attrs = {}) ⇒ Information
constructor
A new instance of Information.
- #to_array(attrs = {}) ⇒ Object
Constructor Details
#initialize(attrs = {}) ⇒ Information
Returns a new instance of Information.
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/nfe_reader/information.rb', line 7 def initialize(attrs = {}) @information = attrs[:infAdFisco] @information_taxpayer = attrs[:infCpl] if attrs[:procRef] @references = to_array(attrs[:procRef]) end if attrs[:obsCont] @taxpayer_messages = to_array(attrs[:obsCont]) end if attrs[:obsFisco] @messages = to_array(attrs[:obsFisco]) end end |
Instance Attribute Details
#information ⇒ Object (readonly)
Returns the value of attribute information.
4 5 6 |
# File 'lib/nfe_reader/information.rb', line 4 def information @information end |
#information_taxpayer ⇒ Object (readonly)
Returns the value of attribute information_taxpayer.
4 5 6 |
# File 'lib/nfe_reader/information.rb', line 4 def information_taxpayer @information_taxpayer end |
#messages ⇒ Object (readonly)
Returns the value of attribute messages.
4 5 6 |
# File 'lib/nfe_reader/information.rb', line 4 def @messages end |
#references ⇒ Object (readonly)
Returns the value of attribute references.
4 5 6 |
# File 'lib/nfe_reader/information.rb', line 4 def references @references end |
#taxpayer_messages ⇒ Object (readonly)
Returns the value of attribute taxpayer_messages.
4 5 6 |
# File 'lib/nfe_reader/information.rb', line 4 def @taxpayer_messages end |
Instance Method Details
#to_array(attrs = {}) ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/nfe_reader/information.rb', line 24 def to_array(attrs = {}) array = [] if attrs.is_a? Array attrs.each do |hash| array << hash.map { |key, value| value } end else array << attrs.map { |key, value| value } end array end |