Class: Trek::PropertiesComponent::ItemComponent

Inherits:
Component
  • Object
show all
Defined in:
app/components/trek/properties_component.rb

Instance Method Summary collapse

Methods included from StimulusHelpers

#stimulus_action, #stimulus_class, #stimulus_class_hash, #stimulus_class_key, #stimulus_target, #stimulus_target_hash, #stimulus_target_key, #stimulus_value, #stimulus_value_hash, #stimulus_value_key

Methods included from CssClassesHelpers

#class_for, #class_names_for, #root_class

Methods included from IdentifierHelper

#identifier

Instance Method Details

#callObject



29
30
31
32
33
34
# File 'app/components/trek/properties_component.rb', line 29

def call
  safe_join([
    rendered_title,
    rendered_content
  ].compact)
end

#rendered_contentObject



43
44
45
46
47
48
# File 'app/components/trek/properties_component.rb', line 43

def rendered_content
  tag.dd(
    formatted_content.presence || "",
    class: class_for("content")
  )
end

#rendered_titleObject



36
37
38
39
40
41
# File 'app/components/trek/properties_component.rb', line 36

def rendered_title
  tag.dt(
    title_value,
    class: class_for("title")
  )
end

#title_valueObject



50
51
52
53
54
# File 'app/components/trek/properties_component.rb', line 50

def title_value
  return model.human_attribute_name(title) if model

  title
end