Parent

String

Public Instance Methods

jsonify() click to toggle source
# File lib/netzke/core_ext/string.rb, line 2
def jsonify
  self.camelize(:lower)
end
l() click to toggle source

Converts self to “literal JSON”-string - one that doesn’t get quotes appended when being sent “to_json” method

# File lib/netzke/core_ext/string.rb, line 7
def l
  ActiveSupport::JSON::Variable.new(self)
end
strip_js_comments() click to toggle source

removes JS-comments (both single- and multi-line) from the string

# File lib/netzke/core_ext/string.rb, line 12
def strip_js_comments
  regexp = /\/\/.*$|(?m:\/\*.*?\*\/)/
  self.gsub!(regexp, '')
  # also remove empty lines
  regexp = /^\s*\n/
  self.gsub!(regexp, '')
end
to_b() click to toggle source

"false" => false, "whatever_else" => true

# File lib/netzke/core_ext/string.rb, line 22
def to_b
  self != "false"
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.