Class: Monet::CaptureMap::PathCollection

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
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.



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

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

Instance Attribute Details

#pathsObject

Returns the value of attribute paths.



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

def paths
  @paths
end

#root_urlObject (readonly)

Returns the value of attribute root_url.



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

def root_url
  @root_url
end

Instance Method Details

#add(path) ⇒ Object



20
21
22
# File 'lib/monet/capture_map.rb', line 20

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

#normalized_path(path) ⇒ Object



28
29
30
# File 'lib/monet/capture_map.rb', line 28

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