Class: Monet::CaptureMap::PathCollection
- Inherits:
-
Object
- Object
- Monet::CaptureMap::PathCollection
- Extended by:
- Forwardable
- 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.
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
#paths ⇒ Object
Returns the value of attribute paths.
15 16 17 |
# File 'lib/monet/capture_map.rb', line 15 def paths @paths end |
#root_url ⇒ Object (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 |