Class: Monet::CaptureMap::PathCollection

Inherits:
Object
  • Object
show all
Includes:
URLHelpers
Defined in:
lib/monet/capture_map.rb

Direct Known Subclasses

PathSpider

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(root_uri) ⇒ PathCollection

Returns a new instance of PathCollection.



12
13
14
15
# File 'lib/monet/capture_map.rb', line 12

def initialize(root_uri)
  @root_url = parse_uri(root_uri)
  @paths = []
end

Instance Attribute Details

#pathsObject

Returns the value of attribute paths.



10
11
12
# File 'lib/monet/capture_map.rb', line 10

def paths
  @paths
end

#root_urlObject (readonly)

Returns the value of attribute root_url.



10
11
12
# File 'lib/monet/capture_map.rb', line 10

def root_url
  @root_url
end

Instance Method Details

#add(path) ⇒ Object



17
18
19
# File 'lib/monet/capture_map.rb', line 17

def add(path)
  @paths << normalized_path(path)
end

#normalized_path(path) ⇒ Object



25
26
27
# File 'lib/monet/capture_map.rb', line 25

def normalized_path(path)
  path.chomp "/"
end