Class: WpApiClient::Configuration
- Inherits:
-
Object
- Object
- WpApiClient::Configuration
- Defined in:
- lib/wp_api_client/configuration.rb
Instance Attribute Summary collapse
-
#basic_auth ⇒ Object
Returns the value of attribute basic_auth.
-
#cache ⇒ Object
Returns the value of attribute cache.
-
#debug ⇒ Object
Returns the value of attribute debug.
-
#embed ⇒ Object
Returns the value of attribute embed.
-
#endpoint ⇒ Object
Returns the value of attribute endpoint.
-
#oauth_credentials ⇒ Object
Returns the value of attribute oauth_credentials.
-
#proxy ⇒ Object
Returns the value of attribute proxy.
Instance Method Summary collapse
- #define_mapping(relation, type) ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #request_params ⇒ Object
Constructor Details
#initialize ⇒ Configuration
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_auth ⇒ Object
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 |
#cache ⇒ Object
Returns the value of attribute cache.
24 25 26 |
# File 'lib/wp_api_client/configuration.rb', line 24 def cache @cache end |
#debug ⇒ Object
Returns the value of attribute debug.
23 24 25 |
# File 'lib/wp_api_client/configuration.rb', line 23 def debug @debug end |
#embed ⇒ Object
Returns the value of attribute embed.
21 22 23 |
# File 'lib/wp_api_client/configuration.rb', line 21 def @embed end |
#endpoint ⇒ Object
Returns the value of attribute endpoint.
20 21 22 |
# File 'lib/wp_api_client/configuration.rb', line 20 def endpoint @endpoint end |
#oauth_credentials ⇒ Object
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 |
#proxy ⇒ Object
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_params ⇒ Object
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 |