Parent

Files

String

Public Instance Methods

classify() click to toggle source

Gets the constant when it is defined that corresponds to this string

    # File lib/caricature/core_ext/string.rb, line 13
13:   def classify
14:     Object.const_get self
15:   end
to_qs_parameters() click to toggle source
    # File lib/caricature/clr/aspnet_mvc.rb, line 16
16:   def to_qs_parameters
17:     if self =~ /\?/
18:       parameters = NameValueCollection.new
19:       self.split('?')[1].split("&").each do |pair|
20:         parts = pair.split('=')
21:         parameters.add pair.first, pair.last
22:       end
23:       return parameters
24:     end
25:     nil
26:   end
to_url_filename() click to toggle source
    # File lib/caricature/clr/aspnet_mvc.rb, line 11
11:   def to_url_filename
12:     return self.gsub(/\?.*/, '') if self =~ /\?/
13:     self
14:   end
underscore() click to toggle source

converts a camel cased word to an underscored word

    # File lib/caricature/core_ext/string.rb, line 4
 4:   def underscore
 5:     self.gsub(/::/, '/').
 6:         gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2').
 7:         gsub(/([a-z\d])([A-Z])/,'\1_\2').
 8:         tr("-", "_").
 9:         downcase
10:   end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.