Class: RIESS::Parameter
- Inherits:
-
Object
- Object
- RIESS::Parameter
- Defined in:
- lib/helpers.rb
Instance Attribute Summary collapse
-
#locator_type ⇒ Object
readonly
Returns the value of attribute locator_type.
-
#locator_value ⇒ Object
readonly
Returns the value of attribute locator_value.
-
#regex ⇒ Object
readonly
Returns the value of attribute regex.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(params) ⇒ Parameter
constructor
A new instance of Parameter.
- #parameters ⇒ Object
- #set_locator_type ⇒ Object
- #set_locator_value ⇒ Object
- #set_regex ⇒ Object
- #set_value ⇒ Object
Constructor Details
#initialize(params) ⇒ Parameter
Returns a new instance of Parameter.
7 8 9 10 11 12 13 |
# File 'lib/helpers.rb', line 7 def initialize(params) @params = params set_locator_type set_locator_value set_value set_regex end |
Instance Attribute Details
#locator_type ⇒ Object (readonly)
Returns the value of attribute locator_type.
5 6 7 |
# File 'lib/helpers.rb', line 5 def locator_type @locator_type end |
#locator_value ⇒ Object (readonly)
Returns the value of attribute locator_value.
5 6 7 |
# File 'lib/helpers.rb', line 5 def locator_value @locator_value end |
#regex ⇒ Object (readonly)
Returns the value of attribute regex.
5 6 7 |
# File 'lib/helpers.rb', line 5 def regex @regex end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
5 6 7 |
# File 'lib/helpers.rb', line 5 def value @value end |
Instance Method Details
#parameters ⇒ Object
47 48 49 |
# File 'lib/helpers.rb', line 47 def parameters @params end |
#set_locator_type ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/helpers.rb', line 15 def set_locator_type if @params.keys.include? :id locator_type = :id elsif @params.keys.include? :name locator_type = :name elsif @params.keys.include? :text locator_type = :text elsif @params.keys.include? :search locator_type = :search elsif @params.keys.include? :search_path locator_type = :search_path end @locator_type = locator_type end |
#set_locator_value ⇒ Object
30 31 32 |
# File 'lib/helpers.rb', line 30 def set_locator_value @locator_value = @params[@locator_type] end |
#set_regex ⇒ Object
38 39 40 41 42 43 44 45 |
# File 'lib/helpers.rb', line 38 def set_regex if @params.keys.include? :regex regex = @params[:regex] else regex = false end @regex = regex end |
#set_value ⇒ Object
34 35 36 |
# File 'lib/helpers.rb', line 34 def set_value @value = @params[:value] end |