class Rh::Method
Attributes
klass[R]
name[R]
package[R]
raw_name[R]
source[R]
type[R]
version[R]
Public Class Methods
new(options={})
click to toggle source
# File lib/rh/method.rb, line 10 def initialize(options={}) @klass = options['klass'] @source = options['source'] @package = options['package'] @version = options['version'] @name = options['name'] match = name.match(/(#|::)(.+)/) raise "Invalid method name: #{name} in #{klass.name}" unless match @type = match[1] == '#' ? :instance : :class @raw_name = match[2] end
Public Instance Methods
escaped_name()
click to toggle source
# File lib/rh/method.rb, line 22 def escaped_name CGI.escape(raw_name).gsub('%', '-') end
url()
click to toggle source
# File lib/rh/method.rb, line 26 def url type_string = type == :class ? 'c' : 'i' case source when 'core' "#{core_url}/#{klass.escaped_name}.html#method-#{type_string}-#{escaped_name}" when 'stdlib' "#{stdlib_url}/#{package}/rdoc/#{klass.escaped_name}.html#method-#{type_string}-#{escaped_name}" else raise 'Unable to generate URL' end end