我正在尝试通过IRB测试运行一个小宝石。我在跑:test = Test::Client.new(token: xxx)
。我收到此错误:NameError: uninitialized constant Test
。你能指点我正确的方向吗?感谢您的帮助。
require 'rubygems'
require 'httparty'
module Test
class Client
include HTTParty
API_ENDPOINT = "https://api.example.com/v1"
def initialize(options={})
self.class.base_uri API_ENDPOINT
self.class.headers "Accept" => "application/json", "authorization" => "Bearer #{options[:token]}"
end
end
end