Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/remocon/util/string.rb

Instance Method Summary collapse

Instance Method Details

#to_booleanObject

Raises:

  • (ArgumentError)


8
9
10
11
12
# File 'lib/remocon/util/string.rb', line 8

def to_boolean
  return true if self == "true"
  return false if self == "false"
  raise ArgumentError, "String cannot be converted to Boolean"
end

#to_integerObject



4
5
6
# File 'lib/remocon/util/string.rb', line 4

def to_integer
  Integer(self)
end