Class: Plagiarism::Balance
Instance Attribute Summary
Attributes inherited from Request
Class Method Summary collapse
-
.amount ⇒ Object
Return the amount (in cents) of your remaining Copyscape account balance.
-
.credits ⇒ Object
Return search credits remaining for your Copyscape account.
Methods inherited from Request
Constructor Details
This class inherits a constructor from Plagiarism::Request
Class Method Details
.amount ⇒ Object
Return the amount (in cents) of your remaining Copyscape account balance
11 12 13 14 15 16 17 18 |
# File 'lib/plagiarism/balance.rb', line 11 def amount response = Request.new(:get, o: 'balance').response if response.success? Money.parse(response.doc.css('value').text).cents else raise "An error occurred while attempting to retrieve your account balance" end end |
.credits ⇒ Object
Return search credits remaining for your Copyscape account
23 24 25 26 27 28 29 30 |
# File 'lib/plagiarism/balance.rb', line 23 def credits response = Request.new(:get, o: 'balance').response if response.success? response.doc.css('total').text.to_i else raise "An error occurred while attempting to retrieve your account balance" end end |