I am very new to Ruby, so I am having difficulty understanding the functionality of the code.
I have a class having a structure given below.
1. class MyClass::Container 2. def self.call 3. @containers || {} 4. end 5. 6. def self.[] namespace 7. @containers ||= Hash.new{|h, k| h[k] = new } 8. @containers[namespace] 9. end 10. 11. def add_flag name 12. self.class.attr_reader name 13. end Then I have another module having a structure given below.
1. module MyClass::MyFlag 2. def self.enabled? flag, value = "true", identifier: nil 3. if identifier 4. MyClass::Container[namespace].send(name).value(identifier: identifier) == value 5. else 6. MyClass::Container[namespace].send(name).value == value 7. end 8. end 9. end I am having a problem understanding how line no 4 & 6 are working in MyClass::MyFlag. I mean how the .send .value is working ?.