Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/jss-api/compatibility.rb,
lib/jss-api/ruby_extensions/string.rb
Instance Method Summary collapse
- #force_encoding(args = nil) ⇒ Object
-
#jss_to_bool ⇒ Boolean?
Convert the strings “true” and “false” (after stripping whitespace and downcasing) to TrueClass and FalseClass respectively.
Instance Method Details
#force_encoding(args = nil) ⇒ Object
64 |
# File 'lib/jss-api/compatibility.rb', line 64 def force_encoding(args = nil); self; end |
#jss_to_bool ⇒ Boolean?
Convert the strings “true” and “false” (after stripping whitespace and downcasing) to TrueClass and FalseClass respectively
Return nil if any other string.
36 37 38 39 40 41 42 |
# File 'lib/jss-api/ruby_extensions/string.rb', line 36 def jss_to_bool case self.strip.downcase when "true" then return true when "false" then return false else return nil end # case end |