Class: Particle::OAuthClient

Inherits:
Model
  • Object
show all
Defined in:
lib/particle/oauth_client.rb

Overview

Domain model for one Particle OAuth client

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Model

attribute_reader, #attributes, #id, #inspect

Constructor Details

#initialize(client, attributes) ⇒ OAuthClient

Returns a new instance of OAuthClient.



5
6
7
# File 'lib/particle/oauth_client.rb', line 5

def initialize(client, attributes)
  super(client, attributes)
end

Class Method Details

.create_pathObject



31
32
33
# File 'lib/particle/oauth_client.rb', line 31

def self.create_path
  "/v1/clients"
end

.list_pathObject



27
28
29
# File 'lib/particle/oauth_client.rb', line 27

def self.list_path
  "/v1/clients"
end

Instance Method Details

#get_attributesObject

OAuth clients can’t be loaded. What you see is what you get…



11
12
13
14
# File 'lib/particle/oauth_client.rb', line 11

def get_attributes
  @loaded = true
  @attributes
end

#pathObject



35
36
37
# File 'lib/particle/oauth_client.rb', line 35

def path
  "/v1/clients/#{id}"
end

#removeboolean

Remove this OAuth client

Examples:

client = Particle.oauth_clients.first
client.remove

Returns:

  • (boolean)

    true for success



23
24
25
# File 'lib/particle/oauth_client.rb', line 23

def remove
  @client.remove_oauth_client(self)
end