123456789_123456789_123456789_123456789_123456789_

Class: Capybara::Selenium::Node::ClickOptions

Relationships & Source Files
Inherits: Object
Defined in: lib/capybara/selenium/node.rb

Overview

ClickOptions encapsulates click option logic

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Constructor Details

.new(keys, options) ⇒ ClickOptions

[ GitHub ]

  
# File 'lib/capybara/selenium/node.rb', line 610

def initialize(keys, options)
  @keys = keys
  @options = options
end

Instance Attribute Details

#center_offset?Boolean (readonly)

[ GitHub ]

  
# File 'lib/capybara/selenium/node.rb', line 623

def center_offset?
  options[:offset] == :center
end

#coords?Boolean (readonly)

[ GitHub ]

  
# File 'lib/capybara/selenium/node.rb', line 615

def coords?
  options[:x] && options[:y]
end

#empty?Boolean (readonly)

[ GitHub ]

  
# File 'lib/capybara/selenium/node.rb', line 627

def empty?
  keys.empty? && !coords? && delay.zero?
end

#keys (readonly)

[ GitHub ]

  
# File 'lib/capybara/selenium/node.rb', line 608

attr_reader :keys, :options

#options (readonly)

[ GitHub ]

  
# File 'lib/capybara/selenium/node.rb', line 608

attr_reader :keys, :options

Instance Method Details

#coords (readonly)

[ GitHub ]

  
# File 'lib/capybara/selenium/node.rb', line 619

def coords
  [options[:x], options[:y]]
end

#delay

[ GitHub ]

  
# File 'lib/capybara/selenium/node.rb', line 631

def delay
  options[:delay] || 0
end