Class: SiteMaps::Adapters::FileSystem::Location
- Inherits:
-
Struct
- Object
- Struct
- SiteMaps::Adapters::FileSystem::Location
- Defined in:
- lib/site_maps/adapters/file_system/location.rb
Direct Known Subclasses
Constant Summary collapse
- ROOT_RE =
%r{^/}- GZIP_RE =
%r{\.gz$}
Instance Attribute Summary collapse
-
#root ⇒ Object
Returns the value of attribute root.
-
#url ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
Instance Attribute Details
#root ⇒ Object
Returns the value of attribute root
3 4 5 |
# File 'lib/site_maps/adapters/file_system/location.rb', line 3 def root @root end |
#url ⇒ Object
Returns the value of attribute url
3 4 5 |
# File 'lib/site_maps/adapters/file_system/location.rb', line 3 def url @url end |
Instance Method Details
#directory ⇒ Object
14 15 16 |
# File 'lib/site_maps/adapters/file_system/location.rb', line 14 def directory Pathname.new(root).join(remote_relative_dir).to_s end |
#gzip? ⇒ Boolean
18 19 20 |
# File 'lib/site_maps/adapters/file_system/location.rb', line 18 def gzip? GZIP_RE.match?(uri.path) end |
#path ⇒ Object
7 8 9 10 11 12 |
# File 'lib/site_maps/adapters/file_system/location.rb', line 7 def path File.join( root, make_relative(uri.path) ) end |