Module: TechRadar::ApplicationHelper

Defined in:
app/helpers/tech_radar/application_helper.rb

Instance Method Summary collapse

Instance Method Details

#label_color_for_ring(ring_name) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'app/helpers/tech_radar/application_helper.rb', line 3

def label_color_for_ring(ring_name)
  if ring_name == 'Adopt'
    :success
  elsif ring_name == 'Hold'
    :warning
  else
    :default
  end
end

#panel_type_for_technology_why(technology) ⇒ Object



13
14
15
16
17
18
19
# File 'app/helpers/tech_radar/application_helper.rb', line 13

def panel_type_for_technology_why(technology)
  if technology.why_summary.blank? && warn_on_missing_why?(technology)
    :warning
  else
    :default
  end
end

#render_summary(summary_text) ⇒ Object



25
26
27
# File 'app/helpers/tech_radar/application_helper.rb', line 25

def render_summary(summary_text)
  TechRadar::Rendering.renderer.render_text(summary_text)
end

#warn_on_missing_why?(technology) ⇒ Boolean

Returns:

  • (Boolean)


21
22
23
# File 'app/helpers/tech_radar/application_helper.rb', line 21

def warn_on_missing_why?(technology)
  technology.ring != 'Adopt' && technology.ring != 'Trial'
end