Class: Pwl::Entry
- Inherits:
-
Object
- Object
- Pwl::Entry
- Includes:
- ActiveModel::Validations
- Defined in:
- lib/pwl/entry.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#password ⇒ Object
Returns the value of attribute password.
-
#uuid ⇒ Object
Returns the value of attribute uuid.
Instance Method Summary collapse
-
#initialize(name = nil) ⇒ Entry
constructor
A new instance of Entry.
-
#validate! ⇒ Object
raises InvalidEntryError if entry is not valid.
Constructor Details
#initialize(name = nil) ⇒ Entry
Returns a new instance of Entry.
18 19 20 21 22 |
# File 'lib/pwl/entry.rb', line 18 def initialize(name = nil) @name = name @uuid = UUID.generate @password = nil end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
12 13 14 |
# File 'lib/pwl/entry.rb', line 12 def name @name end |
#password ⇒ Object
Returns the value of attribute password.
12 13 14 |
# File 'lib/pwl/entry.rb', line 12 def password @password end |
#uuid ⇒ Object
Returns the value of attribute uuid.
12 13 14 |
# File 'lib/pwl/entry.rb', line 12 def uuid @uuid end |
Instance Method Details
#validate! ⇒ Object
raises InvalidEntryError if entry is not valid
27 28 29 |
# File 'lib/pwl/entry.rb', line 27 def validate! raise InvalidEntryError.new(errors) if invalid? end |