Sha256: a47305d9a4d3f1ad4e068fd8a467b108f5dbd014b0a189d53bfa50a617d12783
Contents?: true
Size: 555 Bytes
Versions: 5
Compression:
Stored size: 555 Bytes
Contents
class StripeModelCallbacks::Subscription::StateCheckerService < StripeModelCallbacks::BaseService attr_reader :allowed, :state def initialize(allowed:, state:) @allowed = allowed @state = state.to_s end def perform if state.is_a?(Array) state.each do |state_i| response = Subscription::StateCheckerService.execute!(allowed: allowed, state: state_i) return response unless response.success? end elsif allowed.exclude?(state) return fail! ["Not allowed: #{state}"] end succeed! end end
Version data entries
5 entries across 5 versions & 1 rubygems