Class: ProximityBeacon::Client::Projects

Inherits:
Object
  • Object
show all
Defined in:
lib/proximity_beacon/client/projects.rb

Constant Summary collapse

CLOUD_RESOURCE_ROOT =
"https://cloudresourcemanager.googleapis.com/v1beta1/"

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#credentialsObject

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