
Featured
-
How Regression Testing Detects Integral Errors In Business Processes
Humans are forever changing and evolving and so to
by kristina.rigina -
Get Display Banner Advertising Opportunity on FindNerd Platform
“Do you have a product or service that nee
by manoj.rawat -
Android O Released with Top 7 New Features for App Developers
Android was founded by Andy Rubin, Rich Miner, Nic
by sudhanshu.tripathi -
Top 5 Features That Make Laravel the Best PHP Framework for Development
Laravel is a free open source Web Framework of PHP
by abhishek.tiwari.458 -
Objective C or Swift - Which Technology to Learn for iOS Development?
Swift programming language is completely based on
by siddharth.sindhi
Tags
Arrays and Hash In Ruby
Ruby's arrays and hashes collections having indexes. They can also be said as indexed collections.
Arrays and hashes store collections of objects which can be accessed using a key.
Both arrays and hashes grow as needed to hold...
Iterators and its usage in ruby
In Ruby, iterators are methods basically used by the collections. Collections are a set of objects. Hashes & Arrays are the example of collections. Iteration is a process by which we can get or set the elements in collections. We will discuss...
Few Important Hash Methods in Ruby
Hash:
Hashes are way of storing data in key-value pair format. Key can be any ruby object ( i.e. string, numbers ). Here we will see some of mostly used methods for hashes.
1) Creating/Initializing a hash:
Hash can be created i...
Hash Conditions in Active Records (Rails)
Hash Conditions in Active Records (Rails)
Active records allows us to to pass in array conditions to our query to fetch a single record or all the records matching
the key value pair. In these hash conditions we pass the key as the na...
Ruby Sort an array of objects in hash with case insensitive attribute
To sort an array of objects in hash
@users = User.find(:all)
@users.sort_by(&:employee_name)
Above code will sort @users object with all employee name with Capital letter first and then small letter.
...
How to keep the order in ruby hashes
When we insert the data into a ruby hash it reorders the data in some other order when we use it in view file.So there are cases when we have to show the data in the same order in the order we are inserting the data into ruby hash.So in case wher...