Class: Clash::Web::Client

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/clash-systray/lib/clash/web/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Client

Returns a new instance of Client.



10
11
12
13
# File 'lib/clash-systray/lib/clash/web/client.rb', line 10

def initialize(options)
  @secret = options.fetch(:secret)
  @http = Http.new(self, host: options.fetch(:host), port: options.fetch(:port))
end

Instance Attribute Details

#secretObject (readonly)

Returns the value of attribute secret.



6
7
8
# File 'lib/clash-systray/lib/clash/web/client.rb', line 6

def secret
  @secret
end

Instance Method Details

#apiObject



15
16
17
# File 'lib/clash-systray/lib/clash/web/client.rb', line 15

def api
  @api ||= API.new(self)
end