Class: PagseguroCatcher::Checker
- Inherits:
-
Object
- Object
- PagseguroCatcher::Checker
- Includes:
- HTTParty
- Defined in:
- lib/pagseguro_catcher/checker.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
Returns the value of attribute code.
-
#response ⇒ Object
Returns the value of attribute response.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
- #check(force = false) ⇒ Object
-
#initialize(code, type) ⇒ Checker
constructor
A new instance of Checker.
Constructor Details
#initialize(code, type) ⇒ Checker
Returns a new instance of Checker.
9 10 11 12 |
# File 'lib/pagseguro_catcher/checker.rb', line 9 def initialize(code, type) self.code = code self.type = type end |
Instance Attribute Details
#code ⇒ Object
Returns the value of attribute code.
7 8 9 |
# File 'lib/pagseguro_catcher/checker.rb', line 7 def code @code end |
#response ⇒ Object
Returns the value of attribute response.
7 8 9 |
# File 'lib/pagseguro_catcher/checker.rb', line 7 def response @response end |
#type ⇒ Object
Returns the value of attribute type.
7 8 9 |
# File 'lib/pagseguro_catcher/checker.rb', line 7 def type @type end |
Instance Method Details
#check(force = false) ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/pagseguro_catcher/checker.rb', line 14 def check(force=false) self.response = HTTParty.get(url).body if force self.response ||= HTTParty.get(url).body if self.response PagseguroCatcher::Transaction::Base.new(self.response) end end |