Class: WP::API::Client

Inherits:
Object
  • Object
show all
Includes:
HTTParty, Endpoints
Defined in:
lib/wp/api/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Endpoints

#post, #post_named, #posts

Constructor Details

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

Returns a new instance of Client.



13
14
15
16
17
# File 'lib/wp/api/client.rb', line 13

def initialize(host:, scheme: 'http')
  @scheme = scheme
  @host = host
  fail ':host is required' unless host.is_a?(String) && host.length > 0
end

Instance Attribute Details

#hostObject

Returns the value of attribute host.



11
12
13
# File 'lib/wp/api/client.rb', line 11

def host
  @host
end