X-Git-Url: https://git.r.bdr.sh/rbdr/lyricli.rb/blobdiff_plain/823e558b5cd2ec219d0fc7226c54f2ee7ad807d2..2677b890a58ffaccf47f54615cd3ae6715586ab8:/doc/Lyricli/Util.html?ds=sidebyside diff --git a/doc/Lyricli/Util.html b/doc/Lyricli/Util.html index 71499bf..a126af5 100644 --- a/doc/Lyricli/Util.html +++ b/doc/Lyricli/Util.html @@ -6,7 +6,7 @@ Module: Lyricli::Util - — Documentation by YARD 0.8.1 + — Documentation by YARD 0.8.2.1 @@ -88,8 +88,20 @@
+

Overview

+
+

+This module contains several utility functions. +

+
+
+
+ + +
+ @@ -106,7 +118,7 @@
  • - - (Object) camelize(str) + - (String) camelize(str) @@ -120,7 +132,10 @@ -
    +

    +Transforms a string from snake_case to UpperCamelCase. +

    +
  • @@ -128,7 +143,7 @@
  • - - (Object) parse_class(class_name) + - (Class?) parse_class(class_name) @@ -142,7 +157,11 @@ -
    +

    +Takes a class name in snake_case and attempts to find the corresponding +class from the sources. +

    +
  • @@ -150,7 +169,7 @@
  • - - (Object) sanitize_param(p) + - (String) sanitize_param(p) @@ -164,7 +183,11 @@ -
    +

    +Simply escapes a param and substitutes spaces and escaped plus signs for +plus signs. +

    +
  • @@ -181,24 +204,76 @@

    - - (Object) camelize(str) + - (String) camelize(str) -

    +
    +
    +

    +Transforms a string from snake_case to UpperCamelCase +

    + + +
    +
    +
    +

    Parameters:

    + + +

    Returns:

    + + +
     
     
    -3
    -4
    -5
    +9 +10 +11
    -
    # File 'lib/lyricli/util.rb', line 3
    +      
    # File 'lib/lyricli/util.rb', line 9
     
     def camelize(str)
       str.split('_').map {|w| w.capitalize}.join
    @@ -211,29 +286,82 @@
           

    - - (Object) parse_class(class_name) + - (Class?) parse_class(class_name) -

    +
    +
    +

    +Takes a class name in snake_case and attempts to find the corresponding +class from the sources. +

    + + +
    +
    +
    +

    Parameters:

    +
      + +
    • + + class_name + + + (String) + + + + — +

      +the snake_case name of the class to search for. +

      +
      + +
    • + +
    + +

    Returns:

    +
      + +
    • + + + (Class, nil) + + + + — +

      +the found class or nil +

      +
      + +
    • + +
    + +
     
     
    -7
    -8
    -9
    -10
    -11
    -12
    -13
    -14
    +18 +19 +20 +21 +22 +23 +24 +25
    -
    # File 'lib/lyricli/util.rb', line 7
    +      
    # File 'lib/lyricli/util.rb', line 18
     
     def parse_class(class_name)
       begin
    @@ -251,24 +379,77 @@
           

    - - (Object) sanitize_param(p) + - (String) sanitize_param(p) + + + + +

    +
    +

    +Simply escapes a param and substitutes spaces and escaped plus signs for +plus signs. +

    + +
    +
    +
    +

    Parameters:

    +
      +
    • + + p + + + (String) + + + + — +

      +the parameter to be sanitized +

      +
      + +
    • + +
    +

    Returns:

    +
      + +
    • + + + (String) + + + + — +

      +the sanitized parameter +

      +
      + +
    • - + + +
       
       
      -16
      -17
      -18
      +32 +33 +34
      -
      # File 'lib/lyricli/util.rb', line 16
      +      
      # File 'lib/lyricli/util.rb', line 32
       
       def sanitize_param(p)
         URI.encode_www_form_component(p.gsub(/ /, "+")).gsub("%2B", "+")
      @@ -283,9 +464,9 @@