Class: ArchiveValidator::BaseValidator

Inherits:
Object
  • Object
show all
Includes:
ArchiveImporter::ArchiveHelper
Defined in:
lib/archive_validator/base_validator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from ArchiveImporter::ArchiveHelper

#archive_author_diaspora_id, #contact_groups, #contacts, #others_relayables, #person, #post_subscriptions, #posts, #private_key, #relayables, #serialized_private_key

Constructor Details

#initialize(archive_hash) ⇒ BaseValidator

Returns a new instance of BaseValidator.


8
9
10
11
# File 'lib/archive_validator/base_validator.rb', line 8

def initialize(archive_hash)
  @archive_hash = archive_hash
  validate
end

Instance Attribute Details

#archive_hashObject (readonly)

Returns the value of attribute archive_hash


6
7
8
# File 'lib/archive_validator/base_validator.rb', line 6

def archive_hash
  @archive_hash
end

Instance Method Details

#messagesObject


13
14
15
# File 'lib/archive_validator/base_validator.rb', line 13

def messages
  @messages ||= []
end

#valid?Boolean

Returns:

  • (Boolean)

17
18
19
# File 'lib/archive_validator/base_validator.rb', line 17

def valid?
  @valid.nil? ? messages.empty? : @valid
end