Class: InstallMethod

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::Serialization
Defined in:
app/models/install_method.rb

Overview

Read-only projection of "how do I install this product line?"
information used by the public product page: the marketing blurb,
difficulty rating, and an associated how-to video. Backed by the
HeatingElementProductLineOption lookup tables.

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ InstallMethod

Returns a new instance of InstallMethod.



9
10
11
12
# File 'app/models/install_method.rb', line 9

def initialize(options = {})
  @name = options[:name]
  @product_line = options[:product_line]
end

Instance Method Details

#easeObject



18
19
20
# File 'app/models/install_method.rb', line 18

def ease
  HeatingElementProductLineOption::INSTALLATION_LEVEL_BY_HEATING_SYSTEM_LIST[@name].to_s.capitalize
end

#install_methodObject



14
15
16
# File 'app/models/install_method.rb', line 14

def install_method
  HeatingElementProductLineOption::INSTALLATION_BLURB_BY_HEATING_SYSTEM_LIST[@name]
end

#videoObject



22
23
24
# File 'app/models/install_method.rb', line 22

def video
  ProductLine::VideoRetriever.new(tags: 'for-product-page-how-to-install').process(@product_line).all_videos.first
end