Sha256: 3600dbc3ee8b5ff72d7ffa5c76846cf0ec23dcf1aa89aaecdf461f236e1261ed

Contents?: true

Size: 948 Bytes

Versions: 1

Compression:

Stored size: 948 Bytes

Contents

Dir[File.dirname(__FILE__) + '/wikipedia/**/*.rb'].each { |f| require f }

module Wikipedia
  # Examples :
  # page = Wikipedia.find('Rails')
  # => #<Wikipedia:0x123102>
  # page.content
  # => wiki content appears here

  # basically just a wrapper for doing
  # client = Wikipedia::Client.new
  # client.find('Rails')
  #
  def self.find( page, options = {} )
    client.find( page, options )
  end

  def self.find_image( title, options = {} )
    client.find_image( title, options )
  end

  def self.find_random( options = {} )
    client.find_random( options )
  end

  def self.configure(&block)
    configuration.instance_eval(&block)
  end

  # rubocop:disable Naming/MethodName
  def self.Configure(&block)
    configure(&block)
  end

  class << self
    private

    def configuration
      @configuration ||= Wikipedia::Configuration.new
    end

    def client
      @client ||= Wikipedia::Client.new configuration
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
wikipedia-client-1.17.0 lib/wikipedia.rb