class Ronn::Reference
An individual index reference. A reference can point to one of a few types of locations:
- URLs: "http://man.cx/crontab(5)" - Relative paths to ronn manuals: "crontab.5.ronn"
The url method should be used to obtain the href value for HTML.
Attributes
Public Class Methods
Source
# File lib/ronn/index.rb, line 149 def initialize(index, name, location) @index = index @name = name @location = location end
Public Instance Methods
Source
# File lib/ronn/index.rb, line 179 def path File.expand_path(location, File.dirname(@index.path)) if relative? end
Source
# File lib/ronn/index.rb, line 163 def remote? location =~ /^(?:https?|mailto):/ end
Source
# File lib/ronn/index.rb, line 171 def url if remote? location else location.chomp('.ronn') + '.html' end end