Class: WpApiClient::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/wp_api_client/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



28
29
30
31
# File 'lib/wp_api_client/configuration.rb', line 28

def initialize
  @endpoint = 'http://localhost:8080/wp-json/wp/v2'
  @embed = true
end

Instance Attribute Details

#basic_authObject

Returns the value of attribute basic_auth.



25
26
27
# File 'lib/wp_api_client/configuration.rb', line 25

def basic_auth
  @basic_auth
end

#cacheObject

Returns the value of attribute cache.



24
25
26
# File 'lib/wp_api_client/configuration.rb', line 24

def cache
  @cache
end

#debugObject

Returns the value of attribute debug.



23
24
25
# File 'lib/wp_api_client/configuration.rb', line 23

def debug
  @debug
end

#embedObject

Returns the value of attribute embed.



21
22
23
# File 'lib/wp_api_client/configuration.rb', line 21

def embed
  @embed
end

#endpointObject

Returns the value of attribute endpoint.



20
21
22
# File 'lib/wp_api_client/configuration.rb', line 20

def endpoint
  @endpoint
end

#oauth_credentialsObject

Returns the value of attribute oauth_credentials.



22
23
24
# File 'lib/wp_api_client/configuration.rb', line 22

def oauth_credentials
  @oauth_credentials
end

#proxyObject

Returns the value of attribute proxy.



26
27
28
# File 'lib/wp_api_client/configuration.rb', line 26

def proxy
  @proxy
end

Instance Method Details

#define_mapping(relation, type) ⇒ Object



33
34
35
# File 'lib/wp_api_client/configuration.rb', line 33

def define_mapping(relation, type)
  WpApiClient::Relationship.define(relation, type)
end

#request_paramsObject



37
38
39
40
41
42
43
# File 'lib/wp_api_client/configuration.rb', line 37

def request_params
  params = {}
  if @embed
    params[:_embed] = true
  end
  params
end