Class: Monet::CaptureMap::PathCollection
- Inherits:
-
Object
- Object
- Monet::CaptureMap::PathCollection
- Includes:
- URLHelpers
- Defined in:
- lib/monet/capture_map.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#paths ⇒ Object
Returns the value of attribute paths.
-
#root_url ⇒ Object
readonly
Returns the value of attribute root_url.
Instance Method Summary collapse
- #add(path) ⇒ Object
-
#initialize(root_uri) ⇒ PathCollection
constructor
A new instance of PathCollection.
- #normalized_path(path) ⇒ Object
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
#paths ⇒ Object
Returns the value of attribute paths.
10 11 12 |
# File 'lib/monet/capture_map.rb', line 10 def paths @paths end |
#root_url ⇒ Object (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 |