Module: Wombat::Property::Locators::Factory

Defined in:
lib/wombat/property/locators/factory.rb

Class Method Summary collapse

Class Method Details

.locator_for(property) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/wombat/property/locators/factory.rb', line 17

def self.locator_for(property)
  klass = case(property.wombat_property_format)
  when :text
    Text
  when :list
    List
  when :html
    Html
  when :iterator
    Iterator
  when :container
    PropertyGroup
  when :follow
    Follow
  when :headers
    Headers
  else
    raise Wombat::Property::Locators::UnknownTypeException.new("Unknown property format #{property.format}.")
  end

  klass.new(property)
end