class Dill::RadioButton
A radio button.
Public Class Methods
root(selector)
click to toggle source
Calls superclass method
Dill::Field::root
# File lib/dill/widgets/radio_button.rb, line 16 def self.root(selector) super(["#{selector}"]) end
Public Instance Methods
get()
click to toggle source
@return [String] The text of the checked button's label.
# File lib/dill/widgets/radio_button.rb, line 21 def get if visible?(:checked_label_by_value, value) widget(:checked_label_by_value, value).text elsif visible?(:checked_label_by_id, id) widget(:checked_label_by_id, id).text else nil end end
id()
click to toggle source
@return [String] The id of the checked button.
# File lib/dill/widgets/radio_button.rb, line 37 def id visible?(:checked) ? widget(:checked).id : nil end
set(str)
click to toggle source
First attempts to choose the button by id or label text Then attempts to choose the button by value
# File lib/dill/widgets/radio_button.rb, line 43 def set(str) root.choose(str) rescue begin widget(:button_by_value, str).root.set(true) rescue Dill::MissingWidget => e raise InvalidRadioButton.new(e.message). tap { |x| x.set_backtrace e.backtrace } end end
to_cell()
click to toggle source
# File lib/dill/widgets/radio_button.rb, line 58 def to_cell get end
value()
click to toggle source
@return [String] The value of the checked button.
# File lib/dill/widgets/radio_button.rb, line 32 def value visible?(:checked) ? widget(:checked).root.value : nil end