Class: ZoomEye::API
- Inherits:
-
Object
- Object
- ZoomEye::API
- Defined in:
- lib/zoomeye/api.rb
Instance Method Summary collapse
- #host ⇒ Object
-
#initialize(username: ENV["ZOOMEYE_USERNAME"], password: ENV["ZOOMEYE_PASSWORD"]) ⇒ API
constructor
A new instance of API.
- #resource_info ⇒ Object
- #user ⇒ Object
- #web ⇒ Object
Constructor Details
#initialize(username: ENV["ZOOMEYE_USERNAME"], password: ENV["ZOOMEYE_PASSWORD"]) ⇒ API
Returns a new instance of API.
5 6 7 8 9 10 11 |
# File 'lib/zoomeye/api.rb', line 5 def initialize(username: ENV["ZOOMEYE_USERNAME"], password: ENV["ZOOMEYE_PASSWORD"]) @username = username raise ArgumentError, "No usernamme has been found or provided!" unless @username @password = password raise ArgumentError, "No password has been found or provided!" unless @password end |
Instance Method Details
#host ⇒ Object
21 22 23 |
# File 'lib/zoomeye/api.rb', line 21 def host @host ||= Clients::Host.new(access_token: access_token) end |
#resource_info ⇒ Object
25 26 27 |
# File 'lib/zoomeye/api.rb', line 25 def resource_info @resource_info ||= Clients::ResourceInfo.new(access_token: access_token) end |