Class: SpreeCmCommissioner::PricingModels::PreviewAdjustment

Inherits:
Object
  • Object
show all
Defined in:
lib/spree_cm_commissioner/pricing_models/preview_adjustment.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ PreviewAdjustment

Returns a new instance of PreviewAdjustment.



7
8
9
10
11
12
13
14
15
16
17
# File 'lib/spree_cm_commissioner/pricing_models/preview_adjustment.rb', line 7

def initialize(options = {})
  @id = SecureRandom.uuid
  @label = options[:label]
  @amount = options[:amount]
  @action_type = options[:action_type]
  @pricing_action = options[:pricing_action]
  @adjustable_type = options[:adjustable_type]
  @adjustable_id = options[:adjustable_id]
  @line_item_id = options[:line_item_id]
  @guest_ids = Array(options[:guest_ids])
end

Instance Attribute Details

#action_typeObject (readonly)

Returns the value of attribute action_type.



4
5
6
# File 'lib/spree_cm_commissioner/pricing_models/preview_adjustment.rb', line 4

def action_type
  @action_type
end

#adjustable_idObject (readonly)

Returns the value of attribute adjustable_id.



4
5
6
# File 'lib/spree_cm_commissioner/pricing_models/preview_adjustment.rb', line 4

def adjustable_id
  @adjustable_id
end

#adjustable_typeObject (readonly)

Returns the value of attribute adjustable_type.



4
5
6
# File 'lib/spree_cm_commissioner/pricing_models/preview_adjustment.rb', line 4

def adjustable_type
  @adjustable_type
end

#amountObject (readonly)

Returns the value of attribute amount.



4
5
6
# File 'lib/spree_cm_commissioner/pricing_models/preview_adjustment.rb', line 4

def amount
  @amount
end

#guest_idsObject (readonly)

Returns the value of attribute guest_ids.



4
5
6
# File 'lib/spree_cm_commissioner/pricing_models/preview_adjustment.rb', line 4

def guest_ids
  @guest_ids
end

#idObject (readonly)

Returns the value of attribute id.



4
5
6
# File 'lib/spree_cm_commissioner/pricing_models/preview_adjustment.rb', line 4

def id
  @id
end

#labelObject (readonly)

Returns the value of attribute label.



4
5
6
# File 'lib/spree_cm_commissioner/pricing_models/preview_adjustment.rb', line 4

def label
  @label
end

#line_item_idObject (readonly)

Returns the value of attribute line_item_id.



4
5
6
# File 'lib/spree_cm_commissioner/pricing_models/preview_adjustment.rb', line 4

def line_item_id
  @line_item_id
end

#pricing_actionObject (readonly)

Returns the value of attribute pricing_action.



4
5
6
# File 'lib/spree_cm_commissioner/pricing_models/preview_adjustment.rb', line 4

def pricing_action
  @pricing_action
end