Module: Appom::ElementContainer
Defined Under Namespace
Modules: ClassMethods
Class Method Summary collapse
Instance Method Summary collapse
-
#merge_args(find_args, runtime_args = {}) ⇒ Object
Options re-combiner.
-
#raise_if_block(obj, name, has_block, type) ⇒ Object
Raise if contain a block.
Class Method Details
.included(klass) ⇒ Object
3 4 5 |
# File 'lib/appom/element_container.rb', line 3 def self.included(klass) klass.extend ClassMethods end |
Instance Method Details
#merge_args(find_args, runtime_args = {}) ⇒ Object
Options re-combiner. This takes the original inputs and combines them such that there is only one hash passed as a final argument to Appium.
22 23 24 25 26 27 |
# File 'lib/appom/element_container.rb', line 22 def merge_args(find_args, runtime_args={}) find_args = find_args.dup.flatten runtime_args = runtime_args.dup [*find_args, *runtime_args] end |
#raise_if_block(obj, name, has_block, type) ⇒ Object
Raise if contain a block
8 9 10 11 12 13 14 15 |
# File 'lib/appom/element_container.rb', line 8 def raise_if_block(obj, name, has_block, type) return unless has_block puts "Type passed in: #{type}" puts "#{obj.class}##{name} does not accept blocks" raise Appom::UnsupportedBlockError end |