Class: NfsePrefeituraSp::Types::Simple
- Inherits:
-
Object
- Object
- NfsePrefeituraSp::Types::Simple
- Defined in:
- lib/nfse_prefeitura_sp/types/simple.rb
Instance Attribute Summary collapse
-
#key ⇒ Object
Returns the value of attribute key.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
- #add_tag_to_xml(xml) ⇒ Object
- #has_any_child_value? ⇒ Boolean
-
#initialize(key, value) ⇒ Simple
constructor
A new instance of Simple.
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
#key ⇒ Object
Returns the value of attribute key.
3 4 5 |
# File 'lib/nfse_prefeitura_sp/types/simple.rb', line 3 def key @key end |
#value ⇒ Object
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
10 |
# File 'lib/nfse_prefeitura_sp/types/simple.rb', line 10 def has_any_child_value?; !@value.nil?; end |