Example: marketing

Types Expressions Variables Reserved Words …

2006 available free from Variables $! Exception information$@ Array of backtrace$& String of last match$` String left of last match$ Str right of last match$+ Last group of last match$N Nth group of last match$~ Info about last match$= Case insensitive flag$/ Input record separator$\ Output record separator$, Output field separator$. Line number of last file$> Default output$_ Last input line of string$* Command line args$0 Name of script$$ Process number$ Module names loaded$stderr Standard error output$stdin Standard input$stdout Standard outputReserved WordsaliasandBEGIN beginbreakcaseclassdefdefined?

© 2006 mb@cenophobie.com — available free from www.cenophobie.com/ruby Predefined Variables $! Exception information $@ …

Tags:

  Bury

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Transcription of Types Expressions Variables Reserved Words …

1 2006 available free from Variables $! Exception information$@ Array of backtrace$& String of last match$` String left of last match$ Str right of last match$+ Last group of last match$N Nth group of last match$~ Info about last match$= Case insensitive flag$/ Input record separator$\ Output record separator$, Output field separator$. Line number of last file$> Default output$_ Last input line of string$* Command line args$0 Name of script$$ Process number$ Module names loaded$stderr Standard error output$stdin Standard input$stdout Standard outputReserved WordsaliasandBEGIN beginbreakcaseclassdefdefined?

2 A .. z a .. z string sq string dq #{expr} \t\r\n %q(string sq)%Q(string dq)%(string dq)<<id string id:symbol/regex/opt%r|regex|[1, 2, 3]%w(1 2 3)%W(1 2 #{expr}){1=>2, :s=> v }Expressionsif expr [then] elsif expr [then]elseendunless expr [then] elseendexpr if exprexpr unless exprcase exprwhen compelseendwhile expr [do]enduntil expr [do]enddowhile exprdountil exprfor var in expr [do] [do]endbreak next redo retryModule/Classmodule Nameendclass Nameendclass Name < Supendclass << objenddef name( )enddef (..)endpublicprotectedprivateattr_reader attr_writerattrattr_accessoralias new oldOperators and Precedence::[]**+ - !

3 ~* / %<< >>&| ^> >= < <=<=> == === != =~&&..= ( += -= )notand characters[ ] any single char in set[^ ] any single char not in set*zero or more+one or more?zero or one|alteration( ) Group^Beginning of line or str$End of line or string{1,5} 1 to 5\A Beginning of a string\b Word boundary\B Non-word boundary\d digit, same as [ ]\D Non-digit\s Whitespace\S Non-whitespace\w Word-character\W Non-word-character\z End of a string\Z End of string, before nlVariableslocal@instance@@classCONSTANT C onstants__FILE____LINE__ENVARGFARGVE xceptionsbeginrescue ex => varelseensureendStandardErrorZeroDivisi- onErrorRangeErrorSecurityErrorIOErrorInd exErrorRuntimeErrorRuby arguments-c Check-d Debug-e One Line-h Help-n gets loop-rL require L-v verbose-w warnings-y comp debug 2006 available free from #[num, num/range/regx]

4 -> strStr#capitalize! -> stringStr#center (int [,str]) -> strStr#chomp! ([str]) -> strStr#count -> integerStr#delete! ([string]) -> stringStr#downcase! -> stringStr#each ([str]) do |str| .. endStr#each_line do |line| .. endStr#gsub! (rgx) do |match| .. endStr#include? (str) -> true / falseStr#index (str/reg [,off]) -> intStr#insert (int, string) -> stringStr#length -> integerStr#ljust (int [,padstr]) -> strStr#rindex (str/reg [,off]) -> intStr#rjust (int [,padstr]) -> strStr#scan (rgx) do |match| .. endStr#split (string) -> arrayStr#strip! -> stringStr#sub!

5 (rgx) do |match| .. endStr#swapcase! -> stringStr#to_sym -> symbolStr#tr! (string, string) -> stringStr#upcase! -> stringFileFile#new (path, modestring)-> fileFile#new (path, modestring) do |file| .. endFile#open (path, modestring) do |file| .. endFile#exist? (path) -> t or fFile#basename (path [,suffix]) -> stringFile#delete (path, ..)File#rename (old, new)File#size (path) -> integerrRead-only, from beginningr+ Read-write, from beginningwWrite-only, trunc. / neww+ Read-write, trunc. / newaWrite-only, from end / newa+ Read-write, from end / newbBinary (Windows only)ArrayArray::new (int [,obj]) -> arrayArray#clearArray#map!

6 Do |x| .. endArray#delete (value) -> obj or nilArray#delete_at (index)-> obj or nArray#delete_if do |x| .. endArray#each do |x| .. endArray#flatten! -> arrayArray#include? (value) -> t or fArray#insert (idx, )-> arrayArray#join ([string]) -> stringArray#length -> integerArray#pop -> obj or nilArray#push ( ) -> arrayObjectObj#class -> classObj#freeze -> objectObj#frozen? -> true or falseObj#inspect -> stringObj#is_a? (class) -> true or falseObj#methods -> arrayObj#respond_to? (sym) -> true or falseObj#to_s -> stringDirDir[string] -> arrayDir::chdir ([string])Dir::delete (string)Dir::entries (string) -> arrayDir::foreach (string) do |file|.

7 EndDir::getwd -> stringDir::mkdir (string)Dir::new (string)Dir::open (string) do |dir| .. endDir#closeDir#pos -> integerDir#read -> string or nilDir#rewindHashHash#clearHash#delete (key) -> obj or nilHash#delete_if do |k, v| .. endHash#each do |k, v| .. endHash#has_key? (k) -> true or falseHash#has_value? (v) -> t or fHash#index (value) -> keyHash#keys -> arrayHash#length -> integerHash#select do |k, v| .. end -> arrayHash#values -> arrayTest::Unitassert (boolean [,msg])assert_block (message) do .. endassert_equal (expected, actual [,msg])assert_in_delta (exp, act, dlt [,message])assert_kind_of (klass, object [,msg])assert_match (pattern, string [,msg])assert_nil (object [,msg])assert_no_match (pattern, string [,msg])assert_not_equal (expected, actual [,msg])assert_not_nil (object [,msg])assert_not_same (expected, actual [,msg])assert_respond_to(obj, method [,msg])assert_same (expected, actual [,msg])DateTimeDateTime::nowDateTime::pa rse (str)DateTime::strptime (str, format)DateTime#dayDateTime#hourDateTime #leap?

8 DateTime#minDateTime#monthDateTime#secDa teTime#wdayDateTime#yearKernelblock_give n?eval (str [,binding])raise (exception [,string])fork do .. end => fixnum or nilproc do .. end => procprint (obj)warn (msg)Ruby.


Related search queries