Class: MyMoip::Payer
- Inherits:
-
Object
- Object
- MyMoip::Payer
- Includes:
- ActiveModel::Validations
- Defined in:
- lib/mymoip/payer.rb
Instance Attribute Summary collapse
-
#address_cep ⇒ Object
Returns the value of attribute address_cep.
-
#address_city ⇒ Object
Returns the value of attribute address_city.
-
#address_country ⇒ Object
Returns the value of attribute address_country.
-
#address_neighbourhood ⇒ Object
Returns the value of attribute address_neighbourhood.
-
#address_phone ⇒ Object
Returns the value of attribute address_phone.
-
#address_state ⇒ Object
Returns the value of attribute address_state.
-
#address_street ⇒ Object
Returns the value of attribute address_street.
-
#address_street_extra ⇒ Object
Returns the value of attribute address_street_extra.
-
#address_street_number ⇒ Object
Returns the value of attribute address_street_number.
-
#email ⇒ Object
Returns the value of attribute email.
-
#id ⇒ Object
Returns the value of attribute id.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(attrs) ⇒ Payer
constructor
A new instance of Payer.
- #to_xml(root = nil, formatter = MyMoip::Formatter) ⇒ Object
Constructor Details
#initialize(attrs) ⇒ Payer
Returns a new instance of Payer.
20 21 22 23 24 |
# File 'lib/mymoip/payer.rb', line 20 def initialize(attrs) attrs.each do |attr, value| public_send(:"#{attr}=", value) end end |
Instance Attribute Details
#address_cep ⇒ Object
Returns the value of attribute address_cep.
5 6 7 |
# File 'lib/mymoip/payer.rb', line 5 def address_cep @address_cep end |
#address_city ⇒ Object
Returns the value of attribute address_city.
5 6 7 |
# File 'lib/mymoip/payer.rb', line 5 def address_city @address_city end |
#address_country ⇒ Object
Returns the value of attribute address_country.
5 6 7 |
# File 'lib/mymoip/payer.rb', line 5 def address_country @address_country end |
#address_neighbourhood ⇒ Object
Returns the value of attribute address_neighbourhood.
5 6 7 |
# File 'lib/mymoip/payer.rb', line 5 def address_neighbourhood @address_neighbourhood end |
#address_phone ⇒ Object
Returns the value of attribute address_phone.
5 6 7 |
# File 'lib/mymoip/payer.rb', line 5 def address_phone @address_phone end |
#address_state ⇒ Object
Returns the value of attribute address_state.
5 6 7 |
# File 'lib/mymoip/payer.rb', line 5 def address_state @address_state end |
#address_street ⇒ Object
Returns the value of attribute address_street.
5 6 7 |
# File 'lib/mymoip/payer.rb', line 5 def address_street @address_street end |
#address_street_extra ⇒ Object
Returns the value of attribute address_street_extra.
5 6 7 |
# File 'lib/mymoip/payer.rb', line 5 def address_street_extra @address_street_extra end |
#address_street_number ⇒ Object
Returns the value of attribute address_street_number.
5 6 7 |
# File 'lib/mymoip/payer.rb', line 5 def address_street_number @address_street_number end |
#email ⇒ Object
Returns the value of attribute email.
5 6 7 |
# File 'lib/mymoip/payer.rb', line 5 def email @email end |
#id ⇒ Object
Returns the value of attribute id.
5 6 7 |
# File 'lib/mymoip/payer.rb', line 5 def id @id end |
#name ⇒ Object
Returns the value of attribute name.
5 6 7 |
# File 'lib/mymoip/payer.rb', line 5 def name @name end |
Instance Method Details
#to_xml(root = nil, formatter = MyMoip::Formatter) ⇒ Object
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/mymoip/payer.rb', line 51 def to_xml(root = nil, formatter = MyMoip::Formatter) if root.nil? xml = "" root ||= Builder::XmlMarkup.new(target: xml) end root.Nome(@name) root.Email(@email) root.IdPagador(@id) root.EnderecoCobranca do |n1| n1.Logradouro(@address_street) n1.Numero(@address_street_number) n1.Complemento(@address_street_extra) n1.Bairro(@address_neighbourhood) n1.Cidade(@address_city) n1.Estado(@address_state) n1.Pais(@address_country) n1.CEP(formatter.cep(@address_cep)) n1.TelefoneFixo(formatter.phone(@address_phone)) end xml end |