lib/goliath/goliath.rb in goliath-0.9.0 vs lib/goliath/goliath.rb in goliath-0.9.1
- old
+ new
@@ -4,11 +4,11 @@
# The Goliath Framework
module Goliath
module_function
- @env = 'development'
+ @env = :development
# Retrieves the current goliath environment
#
# @return [String] the current environment
def env
@@ -17,33 +17,33 @@
# Sets the current goliath environment
#
# @param [String] env the environment string of [dev|prod|test]
def env=(env)
- case(env)
- when 'dev' then @env = 'development'
- when 'prod' then @env = 'production'
- when 'test' then @env = 'test'
+ case(env.to_s)
+ when 'dev' then @env = :development
+ when 'prod' then @env = :production
+ when 'test' then @env = :test
end
end
# Determines if we are in the production environment
#
# @return [Boolean] true if current environemnt is production, false otherwise
def prod?
- @env == 'production'
+ @env == :production
end
# Determines if we are in the development environment
#
# @return [Boolean] true if current environemnt is development, false otherwise
def dev?
- @env == 'development'
+ @env == :development
end
# Determines if we are in the test environment
#
# @return [Boolean] true if current environemnt is test, false otherwise
def test?
- @env == 'test'
+ @env == :test
end
end
\ No newline at end of file