Saturday, December 17, 2011

[Rails] Re: (SOT) Change in em-http-request: 0.3.0 => 1.0.0

> r = PhrcRequest.new('http://example.com/')
>
> puts r.inspect
>
> With em-request-http 1.0.0 (the newest version on my system), the output is:
>
> #<EventMachine::HttpConnection:0x7fb4d804a120 @middleware=[], @deferred=true,
>  @uri="http://example.com/", @connopts=#<HttpConnectionOptions:0x7fb4d804a580
>  @port=80, @tls={}, @proxy=nil, @inactivity_timeout=10, @host="example.com",
>  @connect_timeout=5>>
>
> With version 0.3.0 (the gem statement uncommented), the output is:
>
> HERE
> #<PhrcRequest:0x7f130c1891a8 @uri=#<Addressable::URI:0x3f89860c4730 URI:http://example.com/>>
>
> Can someone explain to me how calling new() for one class returns an object of
> another class?  And how I can work around it.  And is this a bug in
> EM::HttpRequest that I should report?
>
new is a method that can be overridden like any other, as you can see
at https://github.com/igrigorik/em-http-request/blob/master/lib/em-http/request.rb
I don't know anything about the innards of em-http-request, so I can
only advise searching through the source to see where the
functionality you were trying to override has gone.

Fred
> TIA,
>   Jeffrey

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate