Module: LightningUiKit::Labelable

Instance Method Summary collapse

Instance Method Details

#effective_labelObject

Returns the effective label text.

  • If @label is explicitly false, returns nil (no label)

  • If @label is a string, returns that string

  • If @label is nil (not provided), generates a label from @name



7
8
9
10
11
# File 'app/components/lightning_ui_kit/labelable.rb', line 7

def effective_label
  return nil if @label == false

  @label.presence || humanized_name
end

#render_label?Boolean

Returns true if a label should be rendered

Returns:

  • (Boolean)


14
15
16
# File 'app/components/lightning_ui_kit/labelable.rb', line 14

def render_label?
  @label != false
end