lib/clamp/parameter/parsing.rb in clamp-0.3.1 vs lib/clamp/parameter/parsing.rb in clamp-0.4.0
- old
+ new
@@ -16,9 +16,21 @@
end
end
end
+ def parse_environment_parameters
+
+ self.class.parameters.each do |parameter|
+ next if parameter.environment_variable.nil?
+ next unless ENV.has_key?(parameter.environment_variable)
+ # Set the parameter value if it's environment variable is present
+ value = ENV[parameter.environment_variable]
+ send("#{parameter.attribute_name}=", value)
+ end
+
+ end
+
end
end
end