Tenzin Chemi
Tenzin Chemi

Tenzin Chemi

Follow
Follow
homebadges
Tag

Ruby

#ruby

More content

Read more stories on Hashnode


Articles with this tag

Remove Nested module constant in ruby

Oct 18, 20231 min read

You might have seen this solution. Object.send(:remove_const, :ExampleClass) But what if you want to remove namespaced classes in Ruby. You can use...

Remove Nested module constant in ruby

Ruby: What is class instance variable

Aug 29, 20231 min read

Class instance variables are variables that have punctual prefix @ and are used inside class definition. class Shape @count = 6 def...

Ruby: What is class instance variable

Ruby: What is a class variable?

Aug 29, 20231 min read

Class variable Class variables are variables prefixed by @@ . class Shape @@no_of_shapes = 6 def instance_method_x puts "No:...

Ruby: What is a class variable?

Ruby tip 0001: Initialize hash from string or array

Aug 9, 20231 min read

Problem: Convert 'ABCD' to {"A"=>0, "B"=>0, "C"=>0, "D"=>0} Using inject 'ABCD'.chars.inject({}) { |memo, v| memo[v] = 0; memo } Using Hash ...

Ruby tip 0001: Initialize hash from string or array

Include, extend, and then get fancy.

Nov 4, 20222 min read

include: makes instance methods from module as instance methods When you include a module inside class. All the instance method from the module...

Include, extend, and then get fancy.