Class: Itch::Client
- Inherits:
-
Object
- Object
- Itch::Client
- Extended by:
- Forwardable
- Includes:
- SimpleInspect
- Defined in:
- lib/itch/client.rb
Overview
The primary client interface
The top level client delegates to child modules for specific app areas like game and purchases pages
Instance Method Summary collapse
- #bundles ⇒ Object
- #game(id = nil, name: nil) ⇒ Object
- #game_map ⇒ Object
-
#initialize(username: nil, password: nil, cookie_path: nil) ⇒ Client
constructor
A new instance of Client.
- #purchases ⇒ Object
Methods included from SimpleInspect
#exclude_inspection, #inspect, #pretty_print_instance_variables
Constructor Details
#initialize(username: nil, password: nil, cookie_path: nil) ⇒ Client
Returns a new instance of Client.
24 25 26 27 28 29 |
# File 'lib/itch/client.rb', line 24 def initialize(username: nil, password: nil, cookie_path: nil) @agent = Mechanize.new @auth = Auth.new(@agent, username: username, password: password, cookie_path: ) @agent..load() if && File.readable?() end |
Instance Method Details
#bundles ⇒ Object
39 40 41 |
# File 'lib/itch/client.rb', line 39 def bundles @bundles ||= Bundles.new(@agent) end |
#game(id = nil, name: nil) ⇒ Object
31 32 33 |
# File 'lib/itch/client.rb', line 31 def game(id = nil, name: nil) Game.new(@agent, game_map, id, name: name) end |