Class: OpenApiSDK::Models::Shared::Discount

Inherits:
Object
  • Object
show all
Extended by:
T::Sig
Includes:
Crystalline::MetadataFields
Defined in:
lib/open_api_sdk/models/shared/discount.rb

Instance Method Summary collapse

Methods included from Crystalline::MetadataFields

#field, #fields, included, #marshal_single, #to_dict, #to_json

Constructor Details

#initialize(id:, amount:, type:, provider:, max_duration: nil) ⇒ Discount

Returns a new instance of Discount.



29
30
31
32
33
34
35
# File 'lib/open_api_sdk/models/shared/discount.rb', line 29

def initialize(id:, amount:, type:, provider:, max_duration: nil)
  @id = id
  @amount = amount
  @type = type
  @provider = provider
  @max_duration = max_duration
end

Instance Method Details

#==(other) ⇒ Object



38
39
40
41
42
43
44
45
46
# File 'lib/open_api_sdk/models/shared/discount.rb', line 38

def ==(other)
  return false unless other.is_a? self.class
  return false unless @id == other.id
  return false unless @amount == other.amount
  return false unless @type == other.type
  return false unless @provider == other.provider
  return false unless @max_duration == other.max_duration
  true
end