Sha256: 3cf9ea34d40c770b7fd3d5188277be651026be3a20f8f19f4f15f25511769a63

Contents?: true

Size: 469 Bytes

Versions: 16

Compression:

Stored size: 469 Bytes

Contents

#coding: utf-8

module Wombat
  module Property
    module Locators
      class Text < Base
        def locate(context, page = nil)
          node = locate_nodes(context)
          node = node.first unless node.is_a?(String)

          value = 
            unless node
              nil
            else 
              node.is_a?(String) ? node.strip : node.inner_text.strip
            end
            
          super { value }
        end
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
wombat-3.0.0 lib/wombat/property/locators/text.rb
wombat-2.10.0 lib/wombat/property/locators/text.rb
wombat-2.9.0 lib/wombat/property/locators/text.rb
wombat-2.8.0 lib/wombat/property/locators/text.rb
wombat-2.7.0 lib/wombat/property/locators/text.rb
wombat-2.6.0 lib/wombat/property/locators/text.rb
wombat-2.5.1 lib/wombat/property/locators/text.rb
wombat-2.5.0 lib/wombat/property/locators/text.rb
wombat-2.4.0 lib/wombat/property/locators/text.rb
wombat-2.3.0 lib/wombat/property/locators/text.rb
wombat-2.2.1 lib/wombat/property/locators/text.rb
wombat-2.2.0 lib/wombat/property/locators/text.rb
wombat-2.1.3 lib/wombat/property/locators/text.rb
wombat-2.1.2 lib/wombat/property/locators/text.rb
wombat-2.1.1 lib/wombat/property/locators/text.rb
wombat-2.1.0 lib/wombat/property/locators/text.rb