Class: Pwl::Entry

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::Validations
Defined in:
lib/pwl/entry.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#nameObject

Returns the value of attribute name.



12
13
14
# File 'lib/pwl/entry.rb', line 12

def name
  @name
end

#passwordObject

Returns the value of attribute password.



12
13
14
# File 'lib/pwl/entry.rb', line 12

def password
  @password
end

#uuidObject

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

Raises:



27
28
29
# File 'lib/pwl/entry.rb', line 27

def validate!
  raise InvalidEntryError.new(errors) if invalid?
end