Sha256: 3c3779229e450e6cf7c47f9125c185fe37909a6bffd586c25221719bbaff1866

Contents?: true

Size: 666 Bytes

Versions: 4

Compression:

Stored size: 666 Bytes

Contents

require 'base64'
require File.join(File.dirname(__FILE__), '..', 'vendor', 'nest', 'nest')

module Lunar
  autoload :Scoring,   'lunar/scoring'
  autoload :Index,     'lunar/index'
  autoload :Words,     'lunar/words'
  autoload :Search,    'lunar/search'
  autoload :Sets,      'lunar/sets'
  autoload :ResultSet, 'lunar/result_set'

  def self.redis(connection = defined?(Ohm) ? Ohm.redis : nil)
    @connection ||= connection 
  end

  def self.search(prefix, keywords, &block)
    search = Search.new(prefix, keywords)
    search.results(&block)
  end

  def self.encode(str)
    Base64.encode64(str).strip 
  end

  def self.nest
    Nest.new(:Lunar)
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
lunar-0.2.3 lib/lunar.rb
lunar-0.2.2 lib/lunar.rb
lunar-0.2.1 lib/lunar.rb
lunar-0.2.0 lib/lunar.rb