data = {name: 'akshay', last_name: 'kakade'}
new_hash = Hash[data]
data.object_id
new_hash.object_id
my_hash = Hash.new #=> { }
# OR
my_hash = {}
grades = Hash.new
grades["Dorothy Doe"] = 9
Code Example |
---|
Ruby :: attr_accessor ruby |
Ruby :: rails route list |
Ruby :: rails rescue puts error |
Ruby :: rails run rspec |
Ruby :: rails logger stdout |
Ruby :: link to do rails |
Ruby :: rails g migration remove default |
Ruby :: ruby for each continue |
Ruby :: ruby create array |
Ruby :: ruby delete first element of array |
Ruby :: ruby rails delete all of a model in console |
Ruby :: ruby array shift |
Ruby :: dynamic database connection in rails |
Ruby :: rails optional reference |
Ruby :: rails string to html |
Ruby :: rails sendgrid setup |
Ruby :: add index in rails |
Ruby :: add elements to ruby hashes |
Ruby :: expect actionmailer base nullmail |
Ruby :: rails prevent division by zero |
Ruby :: devise valid password |
Ruby :: rails include dynamic |
Ruby :: ruby global property from object |
Ruby :: ruby plus plus |
Ruby :: ruby if statement |
R :: list all installed packages in r |
R :: select all columns except one by name in r |
R :: r rename columns |
R :: expression in r |
R :: r ddply |