Class: Rerout::Resources::Project
- Inherits:
-
Object
- Object
- Rerout::Resources::Project
- Defined in:
- lib/rerout/project.rb
Overview
Project-level operations namespace.
Instance Method Summary collapse
-
#initialize(client) ⇒ Project
constructor
A new instance of Project.
-
#me ⇒ Rerout::Models::Project
Info about the project that owns the current API key.
-
#stats(days: 30) ⇒ Rerout::Models::ProjectStats
Aggregate stats across every link in the project.
Constructor Details
#initialize(client) ⇒ Project
Returns a new instance of Project.
8 9 10 |
# File 'lib/rerout/project.rb', line 8 def initialize(client) @client = client end |
Instance Method Details
#me ⇒ Rerout::Models::Project
Info about the project that owns the current API key.
28 29 30 31 |
# File 'lib/rerout/project.rb', line 28 def me response = @client.request(method: :get, path: '/v1/projects/me') Models::Project.from_hash(response) end |
#stats(days: 30) ⇒ Rerout::Models::ProjectStats
Aggregate stats across every link in the project. Defaults to 30 days.
16 17 18 19 20 21 22 23 |
# File 'lib/rerout/project.rb', line 16 def stats(days: 30) response = @client.request( method: :get, path: '/v1/projects/me/stats', query: { 'days' => days } ) Models::ProjectStats.from_hash(response) end |