Class: YuiRestClient::Widgets::Label

Inherits:
Base
  • Object
show all
Defined in:
lib/yui_rest_client/widgets/label.rb

Overview

Class representing a Label UI. It can be YLabel, YLabel_Heading

Instance Method Summary collapse

Methods inherited from Base

#action, #collect_all, #debug_label, #enabled?, #exists?, #initialize, #property

Methods included from YuiRestClient::Waitable

#wait_until, #wait_while

Constructor Details

This class inherits a constructor from YuiRestClient::Widgets::Base

Instance Method Details

#heading?Boolean

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.

Examples:

Check label with ‘label’ “Product name”

{
  "class": "YLabel_Heading",
  "debug_label": "Product name ...",
  "is_heading": true,
  "label": "Product name",
  "text": "Product name"
}
app.label(label: 'Product name').heading? # true

Returns:

  • (Boolean)

    true if it is a heading, false otherwise.



20
21
22
23
# File 'lib/yui_rest_client/widgets/label.rb', line 20

def heading?
  heading_prop = property(:is_heading)
  !heading_prop.nil? && heading_prop == true
end

#textString

Returns text value for the label.

Examples:

Get text value for YLabel, YLabelHeading

{
  "class": "YLabel",
  "debug_label": "short message",
  "label": "test label",
  "text": "text label"
}
text = app.label(label: 'test label').text # "text label"

Returns:

  • (String)

    value



36
37
38
# File 'lib/yui_rest_client/widgets/label.rb', line 36

def text
  property(:text)
end