class LibyuiClient::Widgets::Label
Class representing a Label
UI. It can be YLabel, YLabel_Heading
Public Instance Methods
heading?()
click to toggle source
Returns if label is a heading being represented in bold in the UI Gets value from 'is_heading' parameter in JSON representation of YLabel_Heading. @return [Boolean] true if it is a heading, false otherwise. @example Check label with 'label' “Product name”
{ "class": "YLabel_Heading", "debug_label": "Product name ...", "is_heading": true, "label": "Product name", "text": "Product name" }
@example
app.label(label: 'Product name').heading? # true
# File lib/libyui_client/widgets/label.rb, line 20 def heading? heading_prop = property(:is_heading) !heading_prop.nil? && heading_prop == true end
text()
click to toggle source
Returns text value for the label. @return [String] value @example Get text value for YLabel, YLabelHeading
{ "class": "YLabel", "debug_label": "short message", "label": "test label", "text": "text label" }
@example
text = app.label(label: 'test label').text # "text label"
# File lib/libyui_client/widgets/label.rb, line 36 def text property(:text) end