Class: PagseguroV2::Sender
- Inherits:
-
Hashie::Dash
- Object
- Hashie::Dash
- PagseguroV2::Sender
- Defined in:
- lib/pagseguro_v2/sender.rb
Instance Method Summary collapse
-
#initialize(attributes) ⇒ Sender
constructor
A new instance of Sender.
- #to_xml(options = {}) ⇒ Object
Constructor Details
#initialize(attributes) ⇒ Sender
Returns a new instance of Sender.
8 9 10 11 12 13 |
# File 'lib/pagseguro_v2/sender.rb', line 8 def initialize(attributes) phone = attributes.delete 'phone' self.phone_area_code = phone['areaCode'] self.phone_number = phone['number'] super(attributes) end |
Instance Method Details
#to_xml(options = {}) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/pagseguro_v2/sender.rb', line 15 def to_xml( = {}) builder = [:builder] || Builder::XmlMarkup.new() builder.sender do |sender| sender.email email if email sender.name name if name if phone_area_number && phone_number sender.phone do |phone| phone.areaCode phone.number end end end end |