Skip to content
Browse files

added inspect method to class

  • Loading branch information...
1 parent 7c78c82 commit e9a50f1a84d49fa51287a4a1a06db2a1d231609d @scalabl3 committed Feb 15, 2013
Showing with 6 additions and 1 deletion.
  1. +5 −0 lib/couchbase_settings.rb
  2. +1 −1 lib/couchbase_settings/version.rb
View
5 lib/couchbase_settings.rb
@@ -15,6 +15,7 @@ def setup!
def find_ymls
main_file = "#{Rails.root.to_s}/config/couchbase.yml"
couchbase_main_file = File.exists?(main_file) ? [main_file] : []
+ couchbase_main_file
end
def create_cbsettings_class(yml_file)
@@ -27,6 +28,10 @@ def create_cbsettings_class(yml_file)
#Rails.logger.debug "hash: key = #{key}, value = #{value}"
klass.define_singleton_method(key){ value }
end
+
+ # add a method to inspect the entire yml hash
+ klass.define_singleton_method("inspect", hash)
+
klass.class_eval do
def self.method_missing(method_id,*args)
raise UndefinedCouchbaseSettings, "#{method_id} is not defined in #{self.to_s}"
View
2 lib/couchbase_settings/version.rb
@@ -1,3 +1,3 @@
module CouchbaseSettings
- VERSION = "0.1.1"
+ VERSION = "0.1.2"
end

0 comments on commit e9a50f1

Please sign in to comment.
Something went wrong with that request. Please try again.