Module: ShowcaseTaxonomies

Defined in:
app/lib/showcase_taxonomies.rb

Constant Summary collapse

FLOORING_URLS =

Centralized mappings for flooring and surface types to CMS URLs

{
  'Tile, Marble, or Stone' => '/floor-heating/tile-marble-or-stone',
  'Luxury Vinyl' => '/floor-heating/luxury-vinyl-tiles',
  'Laminate' => '/floor-heating/laminate',
  'Engineered Wood' => '/floor-heating/engineered-wood',
  'Nailed Hardwood' => '/floor-heating/nailed-hardwood',
  'Bamboo' => '/floor-heating/bamboo',
  'Carpet' => '/floor-heating/carpet',
  'Concrete' => '/floor-heating/concrete'
}.freeze
SURFACE_URLS =
{
  'Asphalt' => '/snow-melting/asphalt',
  'Concrete' => '/snow-melting/concrete',
  'Pavers / Stone' => '/snow-melting/heated-pavers-and-stone'
}.freeze
ROOF_URLS =
{
  'Metal Roofs' => '/roof-and-gutter-deicing/metal-roof',
  'Asphalt Shingle Roofs' => '/roof-and-gutter-deicing/asphalt-shingle-roof',
  'Slate Shingle Roofs' => '/roof-and-gutter-deicing/slate-shingle-roof'
}.freeze
COMBINED_URLS =
FLOORING_URLS
.merge(SURFACE_URLS)
.merge(ROOF_URLS)
.freeze
ROOM_URLS =

Floor Heating: Explore by Room

{
  'Bathroom & Shower' => '/floor-heating/bathroom',
  'Kitchen' => '/floor-heating/kitchen',
  'Living Room' => '/floor-heating/living-room',
  'Bedroom' => '/floor-heating/bedroom',
  'Basement' => '/floor-heating/basement',
  'Laundry & Mudroom' => '/floor-heating/laundry-mudroom',
  'Sunroom' => '/floor-heating/sunroom',
  'Tiny Houses' => '/floor-heating/tiny-house'
}.freeze
APPLICATION_URLS =

Snow Melting: Explore by Application

{
  'Driveways' => '/snow-melting/heated-driveway',
  'Walkways & Paths' => '/snow-melting/heated-walkway-path',
  'Outdoor Stairs' => '/snow-melting/outdoor-stairs',
  'Ramps' => '/snow-melting/accessibility-ramp-deicing',
  'Patios' => '/snow-melting/heated-concrete-patio'
}.freeze
FLOOR_TYPE_SLUG_TO_IDS =

Map marketing URL slugs to FloorType ids in the DB
Use this for filtering Showcase by specific floor types on landing pages

{
  # Floor Heating landing pages
  'luxury-vinyl-tiles' => [10],        # Resilients, Vinyl and LVT
  'tile-marble-or-stone' => [3],       # Tile, Marble or Stone
  'engineered-wood' => [4, 15, 16],    # Engineered (floating, glued, nailed)
  'laminate' => [6, 17, 18],           # Laminate variants
  'nailed-hardwood' => [11],           # Hardwood (nailed)
  'bamboo' => [1, 13, 14],             # Bamboo (nailed, floating, glued)
  'carpet' => [2, 23],                 # Carpet stretch-in and glued
  'concrete' => [5]                    # Exposed concrete (new pour)
}.freeze
ROOM_NAME_TO_TYPE_IDS =

Map visible room names to RoomType ids for Showcase filtering

{
  'Bathroom & Shower' => [2, 19],
  'Kitchen' => [10],
  'Living Room' => [12],
  'Bedroom' => [4],
  'Basement' => [1],
  'Laundry & Mudroom' => [11, 14],
  'Sunroom' => [17],
  'Tiny Houses' => [18] # No explicit tiny-house room type; use Other
}.freeze

Class Method Summary collapse

Class Method Details



122
123
124
# File 'app/lib/showcase_taxonomies.rb', line 122

def self.application_link_for(name)
  APPLICATION_URLS[name]
end

.application_optionsObject



94
95
96
# File 'app/lib/showcase_taxonomies.rb', line 94

def self.application_options
  APPLICATION_URLS.keys
end

.floor_type_ids_for_slug(slug) ⇒ Object

Resolve FloorType ids for a given marketing URL slug (e.g., 'luxury-vinyl-tiles')



131
132
133
# File 'app/lib/showcase_taxonomies.rb', line 131

def self.floor_type_ids_for_slug(slug)
  Array(FLOOR_TYPE_SLUG_TO_IDS[slug.to_s.strip]).map(&:to_i)
end


98
99
100
# File 'app/lib/showcase_taxonomies.rb', line 98

def self.flooring_link_for(name)
  FLOORING_URLS[name]
end

.flooring_optionsObject



78
79
80
# File 'app/lib/showcase_taxonomies.rb', line 78

def self.flooring_options
  FLOORING_URLS.keys
end


106
107
108
# File 'app/lib/showcase_taxonomies.rb', line 106

def self.flooring_surface_link_for(name)
  COMBINED_URLS[name]
end

.flooring_surface_optionsObject



86
87
88
# File 'app/lib/showcase_taxonomies.rb', line 86

def self.flooring_surface_options
  COMBINED_URLS.keys
end


114
115
116
# File 'app/lib/showcase_taxonomies.rb', line 114

def self.roof_link_for(name)
  ROOF_URLS[name]
end

.roof_optionsObject



110
111
112
# File 'app/lib/showcase_taxonomies.rb', line 110

def self.roof_options
  ROOF_URLS.keys
end


118
119
120
# File 'app/lib/showcase_taxonomies.rb', line 118

def self.room_link_for(name)
  ROOM_URLS[name]
end

.room_optionsObject



90
91
92
# File 'app/lib/showcase_taxonomies.rb', line 90

def self.room_options
  ROOM_URLS.keys
end

.room_type_ids_for(room_name) ⇒ Object



126
127
128
# File 'app/lib/showcase_taxonomies.rb', line 126

def self.room_type_ids_for(room_name)
  Array(ROOM_NAME_TO_TYPE_IDS[room_name]).map(&:to_s)
end


102
103
104
# File 'app/lib/showcase_taxonomies.rb', line 102

def self.surface_link_for(name)
  SURFACE_URLS[name]
end

.surface_optionsObject



82
83
84
# File 'app/lib/showcase_taxonomies.rb', line 82

def self.surface_options
  SURFACE_URLS.keys
end