Sign up or Sign in | Share
 
ClearMyBench
Welcome, Guest
Please Login or Register.    Lost Password?
Re:Ruby basics (1 viewing) (1) Guest
Go to bottom Post Reply Favoured: 0
TOPIC: Re:Ruby basics
#4445
ShriNi (User)
Software Techie (PEGA) currently on a Career Break
Platinum Boarder
Posts: 4000
graph
User Offline Click here to see the profile of this user
Gender: Female Location: Secundrabad India Birthdate: 1983-09-29
Re:Ruby basics 3 Years, 11 Months ago Karma: 0  
str <=> other_str

Compares str with other_str, returning -1 (less than), 0 (equal), or 1 (greater than). The comparison is casesensitive.

array | other_array

Returns a new array by joining array with other_array, removing duplicates.
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#4446
ShriNi (User)
Software Techie (PEGA) currently on a Career Break
Platinum Boarder
Posts: 4000
graph
User Offline Click here to see the profile of this user
Gender: Female Location: Secundrabad India Birthdate: 1983-09-29
Re:Ruby basics 3 Years, 11 Months ago Karma: 0  
array << obj

Pushes the given object onto the end of array. This expression returns the array itself, so several appends may be chained together.


8 array <=> other_array


Returns an integer (-1, 0, or +1) if this array is less than, equal to, or greater than other_array.
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#4447
ShriNi (User)
Software Techie (PEGA) currently on a Career Break
Platinum Boarder
Posts: 4000
graph
User Offline Click here to see the profile of this user
Gender: Female Location: Secundrabad India Birthdate: 1983-09-29
Re:Ruby basics 3 Years, 11 Months ago Karma: 0  
array <=> other_array


Returns an integer (-1, 0, or +1) if this array is less than, equal to, or greater than other_array.

array == other_array

Two arrays are equal if they contain the same number of elements and if each element is equal to (according to Object.==) the corresponding element in the other array.
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#4448
ShriNi (User)
Software Techie (PEGA) currently on a Career Break
Platinum Boarder
Posts: 4000
graph
User Offline Click here to see the profile of this user
Gender: Female Location: Secundrabad India Birthdate: 1983-09-29
Re:Ruby basics 3 Years, 11 Months ago Karma: 0  
array.abbrev(pattern = nil)

Calculates the set of unambiguous abbreviations for the strings in self.

If passed a pattern or a string, only the strings matching the pattern or starting with the string are considered
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#4449
ShriNi (User)
Software Techie (PEGA) currently on a Career Break
Platinum Boarder
Posts: 4000
graph
User Offline Click here to see the profile of this user
Gender: Female Location: Secundrabad India Birthdate: 1983-09-29
Re:Ruby basics 3 Years, 11 Months ago Karma: 0  
array.assoc(obj)


Searches through an array whose elements are also arrays comparing obj with the first element of each contained array using obj.==.


Returns the first contained array that matches , or nil if no match is found
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#4450
ShriNi (User)
Software Techie (PEGA) currently on a Career Break
Platinum Boarder
Posts: 4000
graph
User Offline Click here to see the profile of this user
Gender: Female Location: Secundrabad India Birthdate: 1983-09-29
Re:Ruby basics 3 Years, 11 Months ago Karma: 0  
array.at(index)

Returns the element at index. A negative index counts from the end of self. Returns nil if the index is out of range.

array.clear


Removes all elements from array.
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
Go to top Post Reply
get the latest posts directly to your desktop
logo footer   Copyright 2009 - 2013 HotRecruiter.Com - All Rights Reserved