Friday, December 28, 2012

array methods



To get methods used for arrays in ruby, do puts myarray.methods
inspect
to_s
to_a
to_ary
frozen?
==
eql?
hash
[]
[]=
at
fetch
first
last
concat
<<
push
pop
shift
unshift
insert
each
each_index
reverse_each
length
size
empty?
find_index
index
rindex
join
reverse
reverse!
rotate
rotate!
sort
sort!
sort_by!
collect
collect!
map
map!
select
select!
keep_if
values_at
delete
delete_at
delete_if
reject
reject!
zip
transpose
replace
clear
fill
include?
<=>
slice
slice!
assoc
rassoc
+
*
-
&
|
uniq
uniq!
compact
compact!
flatten
flatten!
count
shuffle!
shuffle
sample
cycle
permutation
combination
repeated_permutation
repeated_combination
product
take
take_while
drop
drop_while
pack
entries
sort_by
grep
find
detect
find_all
flat_map
collect_concat
inject
reduce
partition
group_by
all?
any?
one?
none?
min
max
minmax
min_by
max_by
minmax_by
member?
each_with_index
each_entry
each_slice
each_cons
each_with_object
chunk
slice_before
nil?
===
=~
!~
class
singleton_class
clone
dup
initialize_dup
initialize_clone
taint
tainted?
untaint
untrust
untrusted?
trust
freeze
methods
singleton_methods
protected_methods
private_methods
public_methods
instance_variables
instance_variable_get
instance_variable_set
instance_variable_defined?
instance_of?
kind_of?
is_a?
tap
send
public_send
respond_to?
respond_to_missing?
extend
display
method
public_method
define_singleton_method
object_id
to_enum
enum_for
equal?
!
!=
instance_eval
instance_exec
__send__
__id__

No comments:

Post a Comment