class Pwss::Entry

Entry generates an entry for the password safe It is a wrapper to a Hash

Attributes

entry[R]
fields[R]

Public Class Methods

new() click to toggle source
# File lib/pwss/generators/entry.rb, line 10
def initialize
  @entry  = Hash.new
  @fields = [
    "title",
    "url",
    "username",
    "password",
    "recovery_email",
    "description"
  ]
end

Public Instance Methods

ask(arguments = {}) click to toggle source

interactively ask the fields specified in +@fields+

optional hash arguments allows to pass arguments to the input-asking functions (including the default value for a key) See the documentation of Pwss::Fields::ask for more details.

# File lib/pwss/generators/entry.rb, line 28
def ask arguments = {}
  @entry = Hash.new
  @fields.each do |key|
    @entry[key] = Fields.ask key, arguments
  end
end