Class: SpreeCmCommissioner::SessionProductMonitorMetric

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(total:, checked_in:, product_name:, variant:) ⇒ SessionProductMonitorMetric

Returns a new instance of SessionProductMonitorMetric.



5
6
7
8
9
10
# File 'lib/spree_cm_commissioner/session_product_monitor_metric.rb', line 5

def initialize(total:, checked_in:, product_name:, variant:)
  @product_name = product_name
  @variant = variant
  @total = total
  @checked_in = checked_in
end

Instance Attribute Details

#checked_inObject (readonly)

Returns the value of attribute checked_in.



3
4
5
# File 'lib/spree_cm_commissioner/session_product_monitor_metric.rb', line 3

def checked_in
  @checked_in
end

#product_nameObject (readonly)

Returns the value of attribute product_name.



3
4
5
# File 'lib/spree_cm_commissioner/session_product_monitor_metric.rb', line 3

def product_name
  @product_name
end

#totalObject (readonly)

Returns the value of attribute total.



3
4
5
# File 'lib/spree_cm_commissioner/session_product_monitor_metric.rb', line 3

def total
  @total
end

#variantObject (readonly)

Returns the value of attribute variant.



3
4
5
# File 'lib/spree_cm_commissioner/session_product_monitor_metric.rb', line 3

def variant
  @variant
end

Instance Method Details

#no_showObject



12
13
14
# File 'lib/spree_cm_commissioner/session_product_monitor_metric.rb', line 12

def no_show
  total - checked_in
end