Class: NfsePrefeituraSp::Types::Simple

Inherits:
Object
  • Object
show all
Defined in:
lib/nfse_prefeitura_sp/types/simple.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key, value) ⇒ Simple

Returns a new instance of Simple.



5
6
7
8
# File 'lib/nfse_prefeitura_sp/types/simple.rb', line 5

def initialize(key, value)
  @key   = key
  @value = value
end

Instance Attribute Details

#keyObject

Returns the value of attribute key.



3
4
5
# File 'lib/nfse_prefeitura_sp/types/simple.rb', line 3

def key
  @key
end

#valueObject

Returns the value of attribute value.



3
4
5
# File 'lib/nfse_prefeitura_sp/types/simple.rb', line 3

def value
  @value
end

Instance Method Details

#add_tag_to_xml(xml) ⇒ Object



12
13
14
# File 'lib/nfse_prefeitura_sp/types/simple.rb', line 12

def add_tag_to_xml(xml)
  xml.send(@key, @value) if !@value.nil?
end

#has_any_child_value?Boolean

Returns:

  • (Boolean)


10
# File 'lib/nfse_prefeitura_sp/types/simple.rb', line 10

def has_any_child_value?; !@value.nil?; end