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.



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

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

Instance Attribute Details

#pathsObject

Returns the value of attribute paths.



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

def paths
  @paths
end

#root_urlObject (readonly)

Returns the value of attribute root_url.



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

def root_url
  @root_url
end

Instance Method Details

#add(path) ⇒ Object



22
23
24
# File 'lib/monet/capture_map.rb', line 22

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

#normalized_path(path) ⇒ Object



30
31
32
# File 'lib/monet/capture_map.rb', line 30

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