Class: Braspag::Billet
- Inherits:
-
Object
- Object
- Braspag::Billet
- Includes:
- ActiveAttr::Model
- Defined in:
- lib/cbraspag/payment/billet.rb
Defined Under Namespace
Classes: DueDateValidator
Instance Attribute Summary collapse
-
#due_date_on ⇒ Object
Returns the value of attribute due_date_on.
-
#id ⇒ Object
Returns the value of attribute id.
-
#instructions ⇒ Object
Returns the value of attribute instructions.
-
#url ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
- #convert_to(method) ⇒ Object
- #populate!(method, response) ⇒ Object
- #populate_generate_billet!(response) ⇒ Object
- #to_generate_billet ⇒ Object
Instance Attribute Details
#due_date_on ⇒ Object
Returns the value of attribute due_date_on.
31 32 33 |
# File 'lib/cbraspag/payment/billet.rb', line 31 def due_date_on @due_date_on end |
#id ⇒ Object
Returns the value of attribute id.
31 32 33 |
# File 'lib/cbraspag/payment/billet.rb', line 31 def id @id end |
#instructions ⇒ Object
Returns the value of attribute instructions.
31 32 33 |
# File 'lib/cbraspag/payment/billet.rb', line 31 def instructions @instructions end |
#url ⇒ Object
Returns the value of attribute url.
31 32 33 |
# File 'lib/cbraspag/payment/billet.rb', line 31 def url @url end |
Instance Method Details
#convert_to(method) ⇒ Object
38 39 40 |
# File 'lib/cbraspag/payment/billet.rb', line 38 def convert_to(method) self.send("to_#{method}") end |
#populate!(method, response) ⇒ Object
50 51 52 |
# File 'lib/cbraspag/payment/billet.rb', line 50 def populate!(method, response) self.send("populate_#{method}!", response) end |
#populate_generate_billet!(response) ⇒ Object
54 55 56 |
# File 'lib/cbraspag/payment/billet.rb', line 54 def populate_generate_billet!(response) self.url = response[:url] end |
#to_generate_billet ⇒ Object
42 43 44 45 46 47 48 |
# File 'lib/cbraspag/payment/billet.rb', line 42 def to_generate_billet { :number => self.id.to_s, :instructions => self.instructions.to_s, :expiration_date => self.due_date_on.strftime("%d/%m/%y") } end |