Module: Neura::Client

Defined in:
lib/neura-client.rb,
lib/neura-client/device.rb,
lib/neura-client/version.rb,
lib/neura-client/authenticator.rb,
lib/neura-client/pending_action.rb

Defined Under Namespace

Classes: Authenticator, Device, PendingAction

Constant Summary collapse

HOST =
"http://neura.dev"
VERSION =
"0.0.1"

Class Method Summary collapse

Class Method Details

.access_tokenObject



44
45
46
# File 'lib/neura-client.rb', line 44

def access_token
  @access_token ||= authenticator.access_token
end

.access_token=(token) ⇒ Object



40
41
42
# File 'lib/neura-client.rb', line 40

def access_token=(token)
  @access_token = token
end

.authenticatorObject



11
12
13
# File 'lib/neura-client.rb', line 11

def authenticator
  @authenticator ||= Authenticator.new(email: email, password: password)
end

.emailObject



28
29
30
# File 'lib/neura-client.rb', line 28

def email
  @email || "[email protected]"
end

.email=(email) ⇒ Object



24
25
26
# File 'lib/neura-client.rb', line 24

def email=(email)
  @email = email
end

.headersObject



15
16
17
18
19
20
21
22
# File 'lib/neura-client.rb', line 15

def headers
  @headers ||= {
    'Authorization'         => 'Bearer ' + access_token,
    'Accept-Language'       => 'en-us',
    'Connection'            => 'keep-alive',
    'Accept'                => 'application/json'
  }
end

.passwordObject



36
37
38
# File 'lib/neura-client.rb', line 36

def password
  @password || "1234"
end

.password=(password) ⇒ Object



32
33
34
# File 'lib/neura-client.rb', line 32

def password=(password)
  @password = password
end