Class: ProximityBeacon::Client::Projects
- Inherits:
-
Object
- Object
- ProximityBeacon::Client::Projects
- Defined in:
- lib/proximity_beacon/client/projects.rb
Constant Summary collapse
- CLOUD_RESOURCE_ROOT =
"https://cloudresourcemanager.googleapis.com/v1beta1/"
Instance Attribute Summary collapse
-
#credentials ⇒ Object
Returns the value of attribute credentials.
Instance Method Summary collapse
-
#initialize(credentials) ⇒ Projects
constructor
A new instance of Projects.
- #list(params = nil) ⇒ Object
Constructor Details
#initialize(credentials) ⇒ Projects
Returns a new instance of Projects.
9 10 11 |
# File 'lib/proximity_beacon/client/projects.rb', line 9 def initialize(credentials) self.credentials = credentials end |
Instance Attribute Details
#credentials ⇒ Object
Returns the value of attribute credentials.
7 8 9 |
# File 'lib/proximity_beacon/client/projects.rb', line 7 def credentials @credentials end |
Instance Method Details
#list(params = nil) ⇒ Object
13 14 15 16 17 18 |
# File 'lib/proximity_beacon/client/projects.rb', line 13 def list(params = nil) uri = URI(CLOUD_RESOURCE_ROOT + "projects") response = Request.get(uri, credentials, params) json = JSON.parse(response.body) json["projects"].map {|project_json| Project.new(project_json) } end |