Method: WP::API::Client#initialize

Defined in:
lib/wp/api/client.rb

#initialize(host:, scheme: 'http', user: nil, password: nil) ⇒ Client

Returns a new instance of Client.



15
16
17
18
19
20
21
22
# File 'lib/wp/api/client.rb', line 15

def initialize(host:, scheme: 'http', user: nil, password: nil)
  @scheme = scheme
  @host = host
  @user = user
  @password = password

  fail ':host is required' unless host.is_a?(String) && host.length > 0
end