Class: Ecko::Plugins::Stripe::PaymentIntentionGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Ecko::Plugins::Stripe::PaymentIntentionGenerator
- Defined in:
- lib/ecko/plugins/stripe/generators/payment_intent_generator.rb
Constant Summary collapse
- DATA_TYPES =
%w(binary json jsonb).freeze
Instance Method Summary collapse
- #create_migration ⇒ Object
-
#initialize(*args) ⇒ PaymentIntentionGenerator
constructor
A new instance of PaymentIntentionGenerator.
Constructor Details
#initialize(*args) ⇒ PaymentIntentionGenerator
Returns a new instance of PaymentIntentionGenerator.
23 24 25 26 27 28 29 |
# File 'lib/ecko/plugins/stripe/generators/payment_intent_generator.rb', line 23 def initialize(*args) super if DATA_TYPES.exclude?(.fetch(:data_type)) raise Error, "Invalid value for --data-type option. Supported for options are: #{DATA_TYPES.join(", ")}." end end |
Instance Method Details
#create_migration ⇒ Object
31 32 33 |
# File 'lib/ecko/plugins/stripe/generators/payment_intent_generator.rb', line 31 def create_migration template 'create_payment_intent_template.rb', "db/migrate/#{}_create_payable_intent.rb" end |