Module: Yarr::Query::URLCorrector

Defined in:
lib/yarr/query/url_corrector.rb

Overview

Extends the from database url fragment to be a full url.

Mixin that assumes an instance method #origin to exist and return an Origin.

Instance Method Summary collapse

Instance Method Details

#core?Bool

Returns is our origin 'core'.

Returns:

  • (Bool)

    is our origin 'core'


21
22
23
# File 'lib/yarr/query/url_corrector.rb', line 21

def core?
  origin.name == 'core'
end

#urlString

Returns the ri url.

Returns:

  • (String)

    the ri url


11
12
13
14
15
16
17
18
# File 'lib/yarr/query/url_corrector.rb', line 11

def url
  version = Yarr.config.ruby_version
  if core?
    "#{host}/core-#{version}/#{super}"
  else
    "#{host}/stdlib-#{version}/libdoc/#{origin.name}/rdoc/#{super}"
  end
end