Class: KBSecret::Record::Login

Inherits:
Abstract
  • Object
show all
Defined in:
lib/kbsecret/record/login.rb

Overview

Represents a record containing a login (username, password) pair.

Instance Attribute Summary

Attributes inherited from Abstract

#data, #label, #path, #session, #timestamp, #type

Instance Method Summary collapse

Methods inherited from Abstract

data_field, data_fields, gen_methods, #initialize_from_hash, load!, #sync!, #to_h, #to_s, type

Constructor Details

#initialize(session, label, user, pass) ⇒ Login

Returns a new instance of Login.

Parameters:

  • session (Session)

    the session to associate with

  • label (Symbol)

    the new record's label

  • user (String)

    the new record's username

  • pass (String)

    the new record's password



14
15
16
17
18
19
20
21
22
23
# File 'lib/kbsecret/record/login.rb', line 14

def initialize(session, label, user, pass)
  super(session, label)

  @data = {
    login: {
      username: user,
      password: pass,
    },
  }
end