lib/parameters/parameters.rb in parameters-0.1.3 vs lib/parameters/parameters.rb in parameters-0.1.4

- old
+ new

@@ -1,5 +1,6 @@ +require 'parameters/exceptions' require 'parameters/class_param' require 'parameters/instance_param' require 'parameters/exceptions' require 'parameters/extensions/meta' @@ -74,11 +75,11 @@ return ancestor.params[name] end end end - raise(ParamNotFound,"parameter #{name.to_s.dump} was not found in class #{self.name.dump}",caller) + raise(Parameters::ParamNotFound,"parameter #{name.to_s.dump} was not found in class #{self.name.dump}",caller) end # # Returns +true+ if a class parameters with the specified _name_ # exists, returns +false+ otherwise. @@ -269,11 +270,11 @@ # def get_param(name) name = name.to_sym unless has_param?(name) - raise(ParamNotFound,"parameter #{name.to_s.dump} was not found within #{self.to_s.dump}",caller) + raise(Parameters::ParamNotFound,"parameter #{name.to_s.dump} was not found within #{self.to_s.dump}",caller) end return self.params[name] end @@ -316,10 +317,10 @@ def require_params(*names) names.each do |name| name = name.to_s unless instance_variable_get("@#{name}") - raise(MissingParam,"parameter #{name.dump} has no value",caller) + raise(Parameters::MissingParam,"parameter #{name.dump} has no value",caller) end end return true end