Class: Wikilink::Converter::Sites::Wikipedia

Inherits:
Wikilink::Converter::Site show all
Defined in:
lib/wikilink/converter/sites/wikipedia.rb

Constant Summary

Constants inherited from Wikilink::Converter::Site

Wikilink::Converter::Site::CURRENT_SITE_NAME, Wikilink::Converter::Site::DEFAULT_NAMESPACE

Instance Attribute Summary

Attributes inherited from Wikilink::Converter::Site

#options

Instance Method Summary collapse

Methods inherited from Wikilink::Converter::Site

#default_namespace, #namespace, #run

Methods included from ArgumentExtractor

#extract_arguments

Constructor Details

#initialize(options = {}) ⇒ Wikipedia

Returns a new instance of Wikipedia.



7
8
9
10
11
12
13
14
15
16
# File 'lib/wikilink/converter/sites/wikipedia.rb', line 7

def initialize(options = {})
  options[:lang] ||= 'en'
  if options[:name] == CURRENT_SITE
    options[:prefix] ||= '/wiki/'
  else
    options[:prefix] ||= "http://#{options[:lang]}.wikipedia.org/wiki/"
  end

  super(options)
end