Class: WatirCraft::Row
Instance Attribute Summary collapse
-
#row ⇒ Object
readonly
Returns the value of attribute row.
Class Method Summary collapse
- .element(name, &block) ⇒ Object
-
.elements ⇒ Object
:nodoc:.
- .field(name, &block) ⇒ Object
-
.fields ⇒ Object
:nodoc:.
Instance Method Summary collapse
-
#exist? ⇒ Boolean
Returns true.
-
#initialize(watir_row) ⇒ Row
constructor
A new instance of Row.
Constructor Details
#initialize(watir_row) ⇒ Row
Returns a new instance of Row.
63 64 65 |
# File 'lib/watircraft/table.rb', line 63 def initialize watir_row @row = watir_row end |
Instance Attribute Details
#row ⇒ Object (readonly)
Returns the value of attribute row.
62 63 64 |
# File 'lib/watircraft/table.rb', line 62 def row @row end |
Class Method Details
.element(name, &block) ⇒ Object
38 39 40 41 42 43 |
# File 'lib/watircraft/table.rb', line 38 def element name, &block elements << name define_method(name) do instance_eval &block end end |
.elements ⇒ Object
:nodoc:
44 45 46 |
# File 'lib/watircraft/table.rb', line 44 def elements # :nodoc: @elements ||= [] end |
.field(name, &block) ⇒ Object
47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/watircraft/table.rb', line 47 def field name, &block fields << name element_name = "#{name}_field" element element_name, &block define_method(name) do send(element_name).display_value end define_method("#{name}=") do | value | send(element_name).set value end end |
.fields ⇒ Object
:nodoc:
58 59 60 |
# File 'lib/watircraft/table.rb', line 58 def fields # :nodoc: @fields ||= [] end |
Instance Method Details
#exist? ⇒ Boolean
Returns true. If the row doesn’t exist, you’ll get nil as the return value of Table#row.
68 69 70 |
# File 'lib/watircraft/table.rb', line 68 def exist? true end |