Module: GettyUp::Configurable

Included in:
GettyUp, Client
Defined in:
lib/getty_up/configurable.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#api_password=(value) ⇒ Object (writeonly)

Sets the attribute api_password

Parameters:

  • value

    the value to set the attribute api_password to.



3
4
5
# File 'lib/getty_up/configurable.rb', line 3

def api_password=(value)
  @api_password = value
end

#api_username=(value) ⇒ Object (writeonly)

Sets the attribute api_username

Parameters:

  • value

    the value to set the attribute api_username to.



3
4
5
# File 'lib/getty_up/configurable.rb', line 3

def api_username=(value)
  @api_username = value
end

#secret_tokenObject

Returns the value of attribute secret_token.



4
5
6
# File 'lib/getty_up/configurable.rb', line 4

def secret_token
  @secret_token
end

#statusObject

Returns the value of attribute status.



4
5
6
# File 'lib/getty_up/configurable.rb', line 4

def status
  @status
end

#system_id=(value) ⇒ Object (writeonly)

Sets the attribute system_id

Parameters:

  • value

    the value to set the attribute system_id to.



3
4
5
# File 'lib/getty_up/configurable.rb', line 3

def system_id=(value)
  @system_id = value
end

#system_password=(value) ⇒ Object (writeonly)

Sets the attribute system_password

Parameters:

  • value

    the value to set the attribute system_password to.



3
4
5
# File 'lib/getty_up/configurable.rb', line 3

def system_password=(value)
  @system_password = value
end

#tokenObject

Returns the value of attribute token.



4
5
6
# File 'lib/getty_up/configurable.rb', line 4

def token
  @token
end

#token_durationObject

Returns the value of attribute token_duration.



4
5
6
# File 'lib/getty_up/configurable.rb', line 4

def token_duration
  @token_duration
end

#token_expirationObject

Returns the value of attribute token_expiration.



4
5
6
# File 'lib/getty_up/configurable.rb', line 4

def token_expiration
  @token_expiration
end

Class Method Details

.keysObject



7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/getty_up/configurable.rb', line 7

def keys
  @keys ||= [
    :system_id,
    :system_password,
    :api_username,
    :api_password,
    :status,
    :token,
    :secret_token,
    :token_duration,
    :token_expiration
  ]
end

Instance Method Details

#configure {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:



22
23
24
25
# File 'lib/getty_up/configurable.rb', line 22

def configure
  yield self
  self
end

#credentialsObject



27
28
29
30
31
32
33
34
# File 'lib/getty_up/configurable.rb', line 27

def credentials
  {
    system_id: @system_id,
    system_password: @system_password,
    api_username: @api_username,
    api_password: @api_password
  }
end