stripe-ruby/lib/stripe/invoice.rb
Brandur 7f85eea3ee Fix low hanging Rubocop TODOs
I wanted to see what fixing Rubocop TODOs was like, so I tried to
eliminate all the easy ones. Most of these were pretty easy, and the
changes required are relatively minimal.

Some of the stuff left is harder. Pretty much everything under
`Metrics/*` is going to be a pretty big yak shave. A few of the others
are just going to need a little more work (e.g. `Style/ClassVars` and
`Style/GuardClause`). Going to stop here for now.
2017-09-27 15:07:18 -07:00

30 lines
696 B
Ruby

module Stripe
class Invoice < APIResource
extend Stripe::APIOperations::List
include Stripe::APIOperations::Save
extend Stripe::APIOperations::Create
OBJECT_NAME = "invoice".freeze
def self.upcoming(params, opts = {})
resp, opts = request(:get, upcoming_url, params, opts)
Util.convert_to_stripe_object(resp.data, opts)
end
def pay(params = {}, opts = {})
resp, opts = request(:post, pay_url, params, opts)
initialize_from(resp.data, opts)
end
def self.upcoming_url
resource_url + "/upcoming"
end
private_class_method :upcoming_url
def pay_url
resource_url + "/pay"
end
private :pay_url
end
end