Sha256: 8051ee7bf6455c0c883d3d4ceb02331851461d8138f2c064389b54e2ceed5d43

Contents?: true

Size: 874 Bytes

Versions: 6

Compression:

Stored size: 874 Bytes

Contents

class Application
  
  # An application simply delegates to the routing to handle a request.
  #
  def self.routing
    @routing ||= Routing.new
  end
  def self.call env
    routing.call env
  end
  
  # 
  #
  def self.indexes &block
    indexes_configuration.instance_eval &block
    # TODO Uglyyyyyy.
    ::Indexes.configuration = indexes_configuration
    ::Indexes.setup # TODO Think about setup/reload.
  end
  def self.indexes_configuration
    @indexes || reset_indexes
  end
  def self.reset_indexes
    @indexes = Configuration::Indexes.new # Is instance a problem?
  end
  
  # 
  #
  def self.queries &block
    queries_configuration.instance_eval &block
    routing.freeze
  end
  def self.queries_configuration
    @queries || reset_queries
  end
  def self.reset_queries
    @queries = Configuration::Queries.new routing # Is instance a problem?
  end
  
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
picky-0.0.9 lib/picky/application.rb
picky-0.0.8 lib/picky/application.rb
picky-0.0.7 lib/picky/application.rb
picky-0.0.6 lib/picky/application.rb
picky-0.0.5 lib/picky/application.rb
picky-0.0.4 lib/picky/application.rb