Displaying 2 results from an estimated 2 matches for "someapi".
Did you mean:
someapp
2010 Jun 29
0
Rails 3 and ActiveSupport::Callbacks
...ort::Callbacks
define_callbacks :handle_response
set_callback :handle_response, :after do |response|
# play with the response
end
# some stuff...
def list_users
run_callbacks :handle_response do
# this request returns a response
@someapi.get("/some/resource")
end
end
end
# run
Foo.new.list_users
Currently, in place of |response|, I have |object| as the doc suggests,
which is the class object at runtime. AS callbacks are great for
after/before/around independant processing, but can they be used...
2018 Nov 25
6
RFC: Modernizing our use of auto
...rds.html#beware-unnecessary-copies-with-auto
So, perhaps the guidelines for reviewers needs to adapt, or the coding
guidelines need to adapt.
Currently, reviewers reject code of the form
void foo()
{
auto ParserInstance = Parser::getFromArgs(Args);
if (ParserInstance)
obj.someApi(ParserInstance);
}
as unreadable while
void foo()
{
obj.otherApi(Parser::getFromArgs(Args));
}
is fine. It would be good to have an answer in the coding guidelines to
whether
void foo()
{
if (auto ParserInstance = Parser::getFromArgs(Args); ParserInstance)
ob...