Module: Capybara::Pagemap::Input
- Included in:
- Capybara::Pagemap
- Defined in:
- lib/capybara/pagemap/input.rb
Overview
Input build methods for input selector
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
- #input_build_and_send(method_name, _, _block) ⇒ Object
- #input_getter_build_and_send(method_name, _, _block) ⇒ Object
- #input_method_missing(method_name, args, block) ⇒ Object
- #input_respond_to_missing?(method_name, _include_private = false) ⇒ Boolean
- #input_setter_build_and_send(method_name, args, _block) ⇒ Object
- #input_validator_for(node) ⇒ Object
Instance Method Details
#input_build_and_send(method_name, _, _block) ⇒ Object
24 25 26 27 28 |
# File 'lib/capybara/pagemap/input.rb', line 24 def input_build_and_send(method_name, _, _block) return unless /(?<key>.*)_input$/ =~ method_name && self.class.node_definitions[key.to_sym] build_input(key.to_sym) send(method_name) end |
#input_getter_build_and_send(method_name, _, _block) ⇒ Object
36 37 38 39 40 |
# File 'lib/capybara/pagemap/input.rb', line 36 def input_getter_build_and_send(method_name, _, _block) return unless self.class.node_definitions[method_name.to_sym] define_input_getter(method_name) send(method_name) end |
#input_method_missing(method_name, args, block) ⇒ Object
18 19 20 21 22 |
# File 'lib/capybara/pagemap/input.rb', line 18 def input_method_missing(method_name, args, block) input_build_and_send(method_name, args, block) || input_setter_build_and_send(method_name, args, block) || input_getter_build_and_send(method_name, args, block) end |
#input_respond_to_missing?(method_name, _include_private = false) ⇒ Boolean
42 43 44 |
# File 'lib/capybara/pagemap/input.rb', line 42 def input_respond_to_missing?(method_name, _include_private = false) /(.*)_input$/ =~ method_name || /(.*)=$/ =~ method_name || self.class.node_definitions[(Regexp.last_match(1) || method_name).to_sym] end |
#input_setter_build_and_send(method_name, args, _block) ⇒ Object
30 31 32 33 34 |
# File 'lib/capybara/pagemap/input.rb', line 30 def input_setter_build_and_send(method_name, args, _block) return unless /(?<key>.*)=$/ =~ method_name && self.class.node_definitions[key.to_sym] define_input_setter(key) send(method_name, args.first) end |
#input_validator_for(node) ⇒ Object
14 15 16 |
# File 'lib/capybara/pagemap/input.rb', line 14 def input_validator_for(node) !send("#{node}_input").nil? end |