Class: Search::RoomConfigurationTextPresenter

Inherits:
RoomConfigurationPresenter
  • Object
show all
Defined in:
app/presenters/search/room_configuration_text_presenter.rb

Overview

Text-only variant of RoomConfigurationPresenter.

Instance Method Summary collapse

Instance Method Details

Returns the customer name and account number as plain text, if available.

Returns:

  • (String, nil)

    customer label, or nil



40
41
42
43
44
# File 'app/presenters/search/room_configuration_text_presenter.rb', line 40

def customer_link
  return unless r.has_columns?(:customer_full_name, :customer_id)

  "#{r.customer_full_name} (CN#{r.customer_id})"
end

#has_quotesString

Returns a "Yes"/"No" label for the has_quotes flag.

Returns:

  • (String)

    "Yes" or "No"



49
50
51
# File 'app/presenters/search/room_configuration_text_presenter.rb', line 49

def has_quotes
  h.y r.has_quotes
end

Returns the associated opportunity name as plain text, if available.

Returns:

  • (String, nil)

    the opportunity name, or nil



24
25
26
27
28
# File 'app/presenters/search/room_configuration_text_presenter.rb', line 24

def opportunity_link
  return unless r.has_columns?(:opportunity_name, :opportunity_id)

  r.opportunity_name
end

#priority_labelString

Returns the priority value as plain text.

Returns:

  • (String)

    the priority



10
11
12
# File 'app/presenters/search/room_configuration_text_presenter.rb', line 10

def priority_label
  r.priority
end

Returns the room reference number as plain text.

Returns:

  • (String)

    the reference number



17
18
19
# File 'app/presenters/search/room_configuration_text_presenter.rb', line 17

def room_link
  r.reference_number
end

#stateString

Returns the human-readable state name.

Returns:

  • (String)

    the room configuration state



33
34
35
# File 'app/presenters/search/room_configuration_text_presenter.rb', line 33

def state
  RoomConfiguration.human_state_name(r.state)
end