Specific question: I am trying to find where be_success is defined. In Ubuntu, I used DoubleCmd (a clone of Window's wonderful Total Commander) to scan for be_success without, uh, success. That's the specific question.
So to partially answer my own question, one can find where successful? is defined here:
[109,118]in/home/real-estate-data-mining/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/rack-2.0.3/lib/rack/response.rb 109: 110:moduleHelpers 111:def invalid?; status <100|| status >=600;end 112: 113:def informational?; status >=100&& status <200;end =>114:def successful?; status >=200&& status <300;end 115:def redirection?; status >=300&& status <400;end 116:def client_error?; status >=400&& status <500;end 117:def server_error?; status >=500&& status <600;end
I'm pretty sure there is a metaprogramming technique for finding where/when an object (in Ruby, a class IS an example of an Object) is created.
So, ... How, in Ruby/Rails/Rspec, would one track where be_success comes into existence?
Bonus question: Since a Class is an Object, why does
return Class ?
Similarly, why does BasicObject.class return Class ?