Skip to content

Commit

Permalink
Added convenience methods to access Halcyon.config[:db].
Browse files Browse the repository at this point in the history
  • Loading branch information
mtodd committed Apr 14, 2008
1 parent 96dbca4 commit 5f605df
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion lib/halcyon.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ module Halcyon
class << self

attr_accessor :app
attr_accessor :config
attr_accessor :logger
attr_accessor :config

def version
VERSION.join('.')
Expand All @@ -39,6 +39,19 @@ def root
self.config[:root] || Dir.pwd rescue Dir.pwd
end

# Retreives the current database configuration settings from
# <tt>Halcyon.config</tt>.
def db
Halcyon.config[:db]
end

# Set the DB configuration settings with the value of +config+ which is
# stored in the <tt>Halcyon.config</tt> hash.
# +config+ the configuration settings for the Database.
def db=(config = {})
Halcyon.config[:db] = config.to_mash
end

end

end
Expand Down

0 comments on commit 5f605df

Please sign in to comment.