Class: Boomloop::Authentication::Credentials
- Inherits:
-
Object
- Object
- Boomloop::Authentication::Credentials
- Defined in:
- lib/boomloop/authentication/credentials.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
Returns the value of attribute options.
-
#store ⇒ Object
Returns the value of attribute store.
-
#username ⇒ Object
Returns the value of attribute username.
Instance Method Summary collapse
- #[](key) ⇒ Object
-
#initialize(username, store, options) ⇒ Credentials
constructor
A new instance of Credentials.
- #save ⇒ Object
- #update(tosave) ⇒ Object
Constructor Details
#initialize(username, store, options) ⇒ Credentials
Returns a new instance of Credentials.
6 7 8 9 10 |
# File 'lib/boomloop/authentication/credentials.rb', line 6 def initialize(username, store, ) self.username = username self.store = store self. = || {} end |
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options.
4 5 6 |
# File 'lib/boomloop/authentication/credentials.rb', line 4 def @options end |
#store ⇒ Object
Returns the value of attribute store.
4 5 6 |
# File 'lib/boomloop/authentication/credentials.rb', line 4 def store @store end |
#username ⇒ Object
Returns the value of attribute username.
4 5 6 |
# File 'lib/boomloop/authentication/credentials.rb', line 4 def username @username end |
Instance Method Details
#[](key) ⇒ Object
24 25 26 |
# File 'lib/boomloop/authentication/credentials.rb', line 24 def [](key) self.[key] end |
#save ⇒ Object
20 21 22 |
# File 'lib/boomloop/authentication/credentials.rb', line 20 def save self.store.update(self) end |
#update(tosave) ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/boomloop/authentication/credentials.rb', line 12 def update(tosave) tosave.each do |key, value| self.[key] = value end save end |