Class: Pwss::Entry
- Inherits:
-
Object
- Object
- Pwss::Entry
- Defined in:
- lib/pwss/generators/entry.rb
Overview
Entry generates an entry for the password safe It is a wrapper to a Hash
Direct Known Subclasses
Instance Attribute Summary collapse
-
#entry ⇒ Object
readonly
Returns the value of attribute entry.
-
#fields ⇒ Object
readonly
Returns the value of attribute fields.
Instance Method Summary collapse
-
#ask(arguments = {}) ⇒ Object
interactively ask the fields specified in @fields.
-
#initialize ⇒ Entry
constructor
A new instance of Entry.
Constructor Details
#initialize ⇒ Entry
Returns a new instance of Entry.
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/pwss/generators/entry.rb', line 10 def initialize @entry = Hash.new @fields = [ "title", "url", "username", "password", "recovery_email", "description" ] end |
Instance Attribute Details
#entry ⇒ Object (readonly)
Returns the value of attribute entry.
7 8 9 |
# File 'lib/pwss/generators/entry.rb', line 7 def entry @entry end |
#fields ⇒ Object (readonly)
Returns the value of attribute fields.
8 9 10 |
# File 'lib/pwss/generators/entry.rb', line 8 def fields @fields end |
Instance Method Details
#ask(arguments = {}) ⇒ Object
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.
28 29 30 31 32 33 |
# 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 |