Module: Particle
- Extended by:
- Configurable
- Defined in:
- lib/particle.rb,
lib/particle/error.rb,
lib/particle/model.rb,
lib/particle/token.rb,
lib/particle/client.rb,
lib/particle/device.rb,
lib/particle/default.rb,
lib/particle/version.rb,
lib/particle/webhook.rb,
lib/particle/platform.rb,
lib/particle/connection.rb,
lib/particle/build_target.rb,
lib/particle/configurable.rb,
lib/particle/client/tokens.rb,
lib/particle/client/devices.rb,
lib/particle/client/publish.rb,
lib/particle/client/firmware.rb,
lib/particle/client/webhooks.rb,
lib/particle/client/platforms.rb,
lib/particle/client/build_targets.rb,
lib/particle/response/raise_error.rb,
lib/particle/response/parse_json_symbols.rb
Defined Under Namespace
Modules: Configurable, Connection, Default, Response Classes: BadRequest, BuildTarget, Client, ClientError, Device, Error, Forbidden, MissingTokenError, Model, NotFound, Platform, ServerError, TimedOut, Token, Unauthorized, Webhook
Constant Summary collapse
- VERSION =
"1.2.0".freeze
Instance Attribute Summary
Attributes included from Configurable
#access_token, #api_endpoint, #connection_options, #user_agent
Class Method Summary collapse
- .client ⇒ Object
-
.login(username, password, options = {}) ⇒ Token
Authenticate with Particle and start using the new token as the global token.
Methods included from Configurable
configure, keys, reset!, same_options?
Class Method Details
.client ⇒ Object
9 10 11 12 |
# File 'lib/particle.rb', line 9 def client return @client if @client && @client.() @client = Particle::Client.new() end |
.login(username, password, options = {}) ⇒ Token
Authenticate with Particle and start using the new token as the global token
Delegates actual functionality to the client.
27 28 29 30 31 |
# File 'lib/particle.rb', line 27 def login(username, password, = {}) token = client.login(username, password, ) self.access_token = token.access_token token end |