Class: Monet::CaptureMap

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/monet/capture_map.rb

Defined Under Namespace

Classes: PathCollection, PathSpider

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(root_uri, type = :explicit) {|@path_helper| ... } ⇒ CaptureMap

Returns a new instance of CaptureMap.

Yields:

  • (@path_helper)


58
59
60
61
62
63
# File 'lib/monet/capture_map.rb', line 58

def initialize(root_uri, type=:explicit, &block)
  @type = type
  @path_helper = type_mapper.new root_uri

  yield(@path_helper) if block_given?
end

Instance Attribute Details

#typeObject (readonly)

Returns the value of attribute type.



56
57
58
# File 'lib/monet/capture_map.rb', line 56

def type
  @type
end

Instance Method Details

#type_mapperObject



67
68
69
70
71
72
73
74
# File 'lib/monet/capture_map.rb', line 67

def type_mapper
  case @type
  when :explicit
    PathCollection
  when :spider
    PathSpider
  end
end