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 146 def initialize(index, name, location) 147 @index = index 148 @name = name 149 @location = location 150 end
Public Instance Methods
Source
# File lib/ronn/index.rb 176 def path 177 File.expand_path(location, File.dirname(@index.path)) if relative? 178 end
Source
# File lib/ronn/index.rb 160 def remote? 161 location =~ /^(?:https?|mailto):/ 162 end
Source
# File lib/ronn/index.rb 168 def url 169 if remote? 170 location 171 else 172 location.chomp('.ronn') + '.html' 173 end 174 end