Reputation: 4651
In my Sinatra app, I am using a class with HTTParty as mixin.
class A
include HTTParty
format :json
def fetch arguments
get(:query => arguments)
end
end
When I try to call the fetch (when the class instance is created inside a get
block), I get the following error:
ArgumentError: tried to create Proc object without a block
When I run the get
method as HTTParty.get
all works fine. How I can resolve these name clashes or the problem is with something else? I'd really like to use HTTParty as a mixin, so I can set all the options once.
Thanks in advance!
I am using sinatra 1.3.2 and httparty 0.8.1.
Upvotes: 0
Views: 420
Reputation: 151
The get method is a class method.
Please try to the following, but I've not tried it out yet...
self.class.get
Upvotes: 1