【发布时间】:2014-08-15 23:21:47
【问题描述】:
我的系统上有 HTTParty gem,我可以在 rails 中使用它。
现在我想单独使用它。
我正在尝试:
class Stuff
include HTTParty
def self.y
HTTParty.get('http://www.google.com')
end
end
Stuff.y
但我明白了
$ ruby test_httparty.rb
test_httparty.rb:2:in `<class:Stuff>': uninitialized constant Stuff::HTTParty (NameError)
from test_httparty.rb:1:in `<main>'
07:46:52 durrantm Castle2012 /home/durrantm/Dropnot/_/rails_apps/linker 73845718_get_method
$
【问题讨论】:
标签: ruby class methods gem httparty