Class: Mohawk::Accessors::CheckBox

Inherits:
Object
  • Object
show all
Defined in:
lib/mohawk/accessors/checkbox.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(adapter, locator) ⇒ CheckBox

Returns a new instance of CheckBox.



6
7
8
# File 'lib/mohawk/accessors/checkbox.rb', line 6

def initialize(adapter, locator)
  @view = adapter.window.checkbox(locator)
end

Instance Attribute Details

#viewObject (readonly)

Returns the value of attribute view.



4
5
6
# File 'lib/mohawk/accessors/checkbox.rb', line 4

def view
  @view
end

Instance Method Details

#checked?Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/mohawk/accessors/checkbox.rb', line 10

def checked?
  @view.set?
end

#set_check(should_check) ⇒ Object



14
15
16
17
# File 'lib/mohawk/accessors/checkbox.rb', line 14

def set_check(should_check)
  @view.set if should_check
  @view.clear unless should_check
end

#valueObject



19
20
21
# File 'lib/mohawk/accessors/checkbox.rb', line 19

def value
  @view.value
end