Exception: SpreeCmCommissioner::Seats::BlocksAreOnHoldByOtherGuestError

Inherits:
StandardError
  • Object
show all
Defined in:
app/errors/spree_cm_commissioner/seats/blocks_are_on_hold_by_other_guest_error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(block_label = nil) ⇒ BlocksAreOnHoldByOtherGuestError

Returns a new instance of BlocksAreOnHoldByOtherGuestError.



5
6
7
8
# File 'app/errors/spree_cm_commissioner/seats/blocks_are_on_hold_by_other_guest_error.rb', line 5

def initialize(block_label = nil)
  @block_label = block_label
  super()
end

Instance Attribute Details

#block_labelObject (readonly)

Returns the value of attribute block_label.



3
4
5
# File 'app/errors/spree_cm_commissioner/seats/blocks_are_on_hold_by_other_guest_error.rb', line 3

def block_label
  @block_label
end

Instance Method Details

#messageObject

override



11
12
13
14
15
16
17
# File 'app/errors/spree_cm_commissioner/seats/blocks_are_on_hold_by_other_guest_error.rb', line 11

def message
  if block_label.present?
    I18n.t('line_item.validation.blocks_are_on_hold_by_other_guest_with_label', label: block_label)
  else
    I18n.t('line_item.validation.blocks_are_on_hold_by_other_guest')
  end
end