Class: Ubidots::DatasourceService

Inherits:
Object
  • Object
show all
Defined in:
lib/ubidots/datasource_service.rb

Class Method Summary collapse

Class Method Details

.retrieve(username) ⇒ Object



5
6
7
8
9
# File 'lib/ubidots/datasource_service.rb', line 5

def self.retrieve(username)
  url = "#{Ubidots::API_URL}/users/#{username}/datasources/"
  response = RestClient.get url, { "X-UbidotsApiKey" => @@key }
  JSON.parse(response.body).to_collection_with_finders
end

.retrieve_without_username ⇒ Object



11
12
13
14
15
# File 'lib/ubidots/datasource_service.rb', line 11

def self.retrieve_without_username
  url = "#{Ubidots::API_URL}/users/datasources/"
  response = RestClient.get url, Ubidots::default_headers
  JSON.parse(response.body).to_collection_with_finders
end