Method: PageMagic::Element::Selector#initialize
- Defined in:
- lib/page_magic/element/selector.rb
#initialize(selector = nil, supports_type: false, exact: false, &formatter) ⇒ Selector
Initialize a new selector a block can be supplied to decorate the query. E.g.
38 39 40 41 42 43 44 45 |
# File 'lib/page_magic/element/selector.rb', line 38 def initialize(selector = nil, supports_type: false, exact: false, &formatter) @selector = selector @formatter = formatter || proc { |arg| arg } @supports_type = supports_type @options = {}.tap do |hash| hash[:exact] = true if exact end end |