lib/picky/application.rb in picky-0.11.2 vs lib/picky/application.rb in picky-0.12.0
- old
+ new
@@ -2,49 +2,50 @@
#
class Application
class << self
+ # API
+ #
+
# Returns a configured tokenizer that
# is used for indexing by default.
#
def default_indexing options = {}
- indexing.default_tokenizer options
+ Tokenizers::Index.default = Tokenizers::Index.new(options)
end
# Returns a configured tokenizer that
# is used for querying by default.
#
def default_querying options = {}
- querying.default_tokenizer options
+ Tokenizers::Query.default = Tokenizers::Query.new(options)
end
+ # Returns a new index frontend for configuring the index.
+ #
+ def index *args
+ IndexAPI.new *args
+ end
+
# Routes.
#
delegate :route, :root, :to => :routing
+ #
+ # API
+
+
# An application simply delegates to the routing to handle a request.
#
def call env
routing.call env
end
def routing
@routing ||= Routing.new
end
- def indexing
- @indexing ||= Configuration::Indexes.new
- end
- def querying
- @queries ||= Configuration::Queries.new
- end
- # "API".
- #
- def index *args
- ::Type.new *args
- end
-
# Finalize the subclass as soon as it
# has finished loading.
#
attr_reader :apps
def initialize_apps
@@ -62,10 +63,10 @@
#
def finalize
routing.freeze
end
- # TODO Add more info.
+ # TODO Add more info if possible.
#
def to_s
"#{self.name}:\n#{routing}"
end
\ No newline at end of file