lib/appsent/config_value.rb in appsent-0.0.1 vs lib/appsent/config_value.rb in appsent-0.0.2

- old
+ new

@@ -8,10 +8,10 @@ VALUE_WRONG_TYPE_MSG = "wrong type,should be %s" FULL_ERROR_MESSAGE = "%s: %s # %s%s%s" # data => it's an actual data of parameter def initialize parameter, data_type, data, description, example, &block - @parameter, @data_type, @data, @description, @example = (parameter.to_sym rescue parameter), data_type, data, description, example + @parameter, @data_type, @data, @description, @example = (parameter and parameter.to_sym), data_type, data, description, example @data_type ||= Hash raise WRONG_DATA_TYPE_PASSED_MSG unless @data_type.is_a?(Class) raise "params #{@data_type} and block given" if block_given? and not @data_type==Hash