Module: Orb::Models::CouponCreateParams::Discount
- Extended by:
- Internal::Type::Union
- Defined in:
- lib/orb/models/coupon_create_params.rb
Defined Under Namespace
Classes: Amount, Percentage
Class Method Summary collapse
Instance Method Summary collapse
Methods included from Internal::Type::Union
==, ===, coerce, dump, hash, inspect, to_sorbet_type, variants
Methods included from Internal::Util::SorbetRuntimeSupport
#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type
Methods included from Internal::Type::Converter
#coerce, coerce, #dump, dump, inspect, #inspect, meta_info, new_coerce_state, type_info
Class Method Details
.variants ⇒ Array(Orb::Models::CouponCreateParams::Discount::Percentage, Orb::Models::CouponCreateParams::Discount::Amount)
|
|
# File 'lib/orb/models/coupon_create_params.rb', line 90
|
Instance Method Details
#initialize(percentage_discount: , discount_type: :percentage) ⇒ Object
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
# File 'lib/orb/models/coupon_create_params.rb', line 49 module Discount extend Orb::Internal::Type::Union discriminator :discount_type variant :percentage, -> { Orb::CouponCreateParams::Discount::Percentage } variant :amount, -> { Orb::CouponCreateParams::Discount::Amount } class Percentage < Orb::Internal::Type::BaseModel # @!attribute discount_type # # @return [Symbol, :percentage] required :discount_type, const: :percentage # @!attribute percentage_discount # # @return [Float] required :percentage_discount, Float # @!method initialize(percentage_discount:, discount_type: :percentage) # @param percentage_discount [Float] # @param discount_type [Symbol, :percentage] end class Amount < Orb::Internal::Type::BaseModel # @!attribute amount_discount # # @return [String] required :amount_discount, String # @!attribute discount_type # # @return [Symbol, :amount] required :discount_type, const: :amount # @!method initialize(amount_discount:, discount_type: :amount) # @param amount_discount [String] # @param discount_type [Symbol, :amount] end # @!method self.variants # @return [Array(Orb::Models::CouponCreateParams::Discount::Percentage, Orb::Models::CouponCreateParams::Discount::Amount)] end |