Sha256: 51c48e688bb7c14f50cfc6132f5cd705886b563b43993096dca2aaff46be13ab
Contents?: true
Size: 1.61 KB
Versions: 47
Compression:
Stored size: 1.61 KB
Contents
module Presenter module CepcRr class RecommendationReport def initialize(view_model) @view_model = view_model end def to_hash { assessment_id: @view_model.assessment_id, recommendations: [ @view_model.short_payback_recommendations.map do |recommendation| { payback_type: "short", recommendation_code: recommendation[:code], recommendation: recommendation[:text], cO2_Impact: recommendation[:cO2Impact], } end, @view_model.medium_payback_recommendations.map do |recommendation| { payback_type: "medium", recommendation_code: recommendation[:code], recommendation: recommendation[:text], cO2_Impact: recommendation[:cO2Impact], } end, @view_model.long_payback_recommendations.map do |recommendation| { payback_type: "long", recommendation_code: recommendation[:code], recommendation: recommendation[:text], cO2_Impact: recommendation[:cO2Impact], } end, @view_model.other_recommendations.map do |recommendation| { payback_type: "other", recommendation_code: recommendation[:code], recommendation: recommendation[:text], cO2_Impact: recommendation[:cO2Impact], } end, ].flatten, } end end end end
Version data entries
47 entries across 47 versions & 1 rubygems