Class: WpApiClient::Client
- Inherits:
-
Object
- Object
- WpApiClient::Client
- Defined in:
- lib/wp_api_client/client.rb
Instance Method Summary collapse
- #get(url, params = {}) ⇒ Object
-
#initialize(connection) ⇒ Client
constructor
A new instance of Client.
Constructor Details
#initialize(connection) ⇒ Client
Returns a new instance of Client.
4 5 6 |
# File 'lib/wp_api_client/client.rb', line 4 def initialize(connection) @connection = connection end |
Instance Method Details
#get(url, params = {}) ⇒ Object
8 9 10 11 12 13 |
# File 'lib/wp_api_client/client.rb', line 8 def get(url, params = {}) response = @connection.get(api_path_from(url), params) @headers = response.headers native_representation_of response.body end |