mirror of
https://github.com/stripe/stripe-ruby.git
synced 2025-10-04 00:00:47 -04:00
* Bump Rubocop to 0.57.2 * Style/StderrPuts: Use warn instead of .puts * Style/ExpandPathArguments: Use expand_path('../test_helper', __dir__) instead of expand_path('../../test_helper', __FILE__) * Style/Encoding: Unnecessary utf-8 encoding comment * Style/StringLiterals: Prefer double-quoted strings * Style/AccessModifierDeclarations * Style/FormatStringToken: Prefer annotated tokens * Naming/UncommunicativeMethodParamName * Metrics/LineLength: set maximum line length to 100 characters * Style/IfUnlessModifier: Favor modifier if usage when having a single-line body * Style/ClassVars * Metrics/LineLength: set maximum line length to 80 characters (default) * Style/AccessModifierDeclarations: EnforcedStyle: inline
35 lines
1.2 KiB
Ruby
35 lines
1.2 KiB
Ruby
# frozen_string_literal: true
|
|
|
|
module Stripe
|
|
class SubscriptionScheduleRevision < APIResource
|
|
extend Stripe::APIOperations::List
|
|
|
|
OBJECT_NAME = "subscription_schedule_revision".freeze
|
|
|
|
def resource_url
|
|
if !respond_to?(:schedule) || schedule.nil?
|
|
raise NotImplementedError,
|
|
"Subscription schedule revisions cannot be accessed without a " \
|
|
"subscription schedule ID."
|
|
end
|
|
"#{SubscriptionSchedule.resource_url}/#{CGI.escape(schedule)}" \
|
|
"/revisions/#{CGI.escape(id)}"
|
|
end
|
|
|
|
def self.retrieve(_id, _opts = {})
|
|
raise NotImplementedError,
|
|
"Subscription schedule revisions cannot be retrieved without a " \
|
|
"subscription schedule ID. Retrieve a subscribtion schedule " \
|
|
"revision using `SubscriptionSchedule.retrieve_revision(" \
|
|
"'schedule_id', 'revision_id')`"
|
|
end
|
|
|
|
def self.list(_id, _opts = {})
|
|
raise NotImplementedError,
|
|
"Subscription schedule revisions cannot be listed without a " \
|
|
"subscription schedule ID. List subscribtion schedule revisions " \
|
|
"using `SubscriptionSchedule.list_revisions('schedule_id')`"
|
|
end
|
|
end
|
|
end
|