Class: CorreiosSigep::Models::LogisticReverse
- Inherits:
-
Object
- Object
- CorreiosSigep::Models::LogisticReverse
- Includes:
- DSL::LogisticReverse
- Defined in:
- lib/correios_sigep/models/logistic_reverse.rb
Instance Attribute Summary collapse
-
#collect ⇒ Object
Returns the value of attribute collect.
-
#recipient ⇒ Object
Returns the value of attribute recipient.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ LogisticReverse
constructor
A new instance of LogisticReverse.
- #to_xml ⇒ Object
Methods included from DSL::LogisticReverse
#with_collect, #with_recipient
Constructor Details
Instance Attribute Details
#collect ⇒ Object
Returns the value of attribute collect.
6 7 8 |
# File 'lib/correios_sigep/models/logistic_reverse.rb', line 6 def collect @collect end |
#recipient ⇒ Object
Returns the value of attribute recipient.
6 7 8 |
# File 'lib/correios_sigep/models/logistic_reverse.rb', line 6 def recipient @recipient end |
Class Method Details
.build(&block) ⇒ Object
8 9 10 11 12 |
# File 'lib/correios_sigep/models/logistic_reverse.rb', line 8 def self.build(&block) instance = new instance.instance_eval(&block) instance end |
Instance Method Details
#to_xml ⇒ Object
19 20 21 22 23 24 25 26 27 |
# File 'lib/correios_sigep/models/logistic_reverse.rb', line 19 def to_xml builder = Nokogiri::XML::Builder.new do |xml| xml.root do Builders::XML::Recipient.new(xml, recipient).build_xml Builders::XML::Collect.new(xml, collect).build_xml end end builder.to_xml end |