Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/generators/capistrano_deploy/lib/core_extensions.rb

Instance Method Summary collapse

Instance Method Details

#to_boolObject

Raises:

  • (ArgumentError)


2
3
4
5
6
# File 'lib/generators/capistrano_deploy/lib/core_extensions.rb', line 2

def to_bool
  return true if self =~ (/^(yes|y)$/i)
  return false if self =~ (/^(no|n)$/i)
  raise ArgumentError.new("invalid value for Boolean: \"#{self}\"")
end