Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/git-process/git_config.rb,
lib/git-process/git_remote.rb

Instance Method Summary collapse

Instance Method Details

#to_booleanObject

Raises:

  • (ArgumentError)


22
23
24
25
26
# File 'lib/git-process/git_config.rb', line 22

def to_boolean
  return false if self == false || self.nil? || self =~ (/(false|f|no|n|0)$/i)
  return true if self == true || self =~ (/(true|t|yes|y|1)$/i)
  raise ArgumentError.new("invalid value for Boolean: \"#{self}\"")
end