Class: Kiba::Extend::Registry::FileRegistryEntry

Inherits:
Object
  • Object
show all
Includes:
EntrySummarizable, EntryValidatable, Treeable
Defined in:
lib/kiba/extend/registry/file_registry_entry.rb

Overview

Captures the data about an entry in the file registry

This is the underlying data that can be used to derive a registered source, destination, or lookup file object.

Used instead of just passing around a Hash so that it can validate itself and carry its own errors/warnings

Since:

  • 2.2.0

Constant Summary

Constants included from EntryValidatable

EntryValidatable::TYPES

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Treeable

#ancestors, #diagram, #mermaid, #parents

Methods included from NodeLabelable

#node_label

Methods included from EntrySummarizable

#summary

Constructor Details

#initialize(key, reghash) ⇒ FileRegistryEntry

Returns a new instance of FileRegistryEntry.

Parameters:

Since:

  • 2.2.0



26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/kiba/extend/registry/file_registry_entry.rb', line 26

def initialize(key, reghash)
  @key = key
  @type = :file
  @creator = nil
  @desc = ""
  @dest_class = Kiba::Extend.destination
  @dest_opt = nil
  @dest_special_opts = nil
  @lookup_on = nil
  @path = nil
  @src_class = Kiba::Extend.source
  @src_opt = nil
  @supplied = false
  @tags = []
  @valid = false
  @errors = {}
  @warnings = []
  assign_values_from(reghash)
  validate
end

Instance Attribute Details

#creatorObject (readonly)

Since:

  • 2.2.0



18
19
20
# File 'lib/kiba/extend/registry/file_registry_entry.rb', line 18

def creator
  @creator
end

#descObject (readonly)

Since:

  • 2.2.0



18
19
20
# File 'lib/kiba/extend/registry/file_registry_entry.rb', line 18

def desc
  @desc
end

#dest_classObject (readonly)

Since:

  • 2.2.0



18
19
20
# File 'lib/kiba/extend/registry/file_registry_entry.rb', line 18

def dest_class
  @dest_class
end

#dest_optObject (readonly)

Since:

  • 2.2.0



18
19
20
# File 'lib/kiba/extend/registry/file_registry_entry.rb', line 18

def dest_opt
  @dest_opt
end

#dest_special_optsObject (readonly)

Since:

  • 2.2.0



18
19
20
# File 'lib/kiba/extend/registry/file_registry_entry.rb', line 18

def dest_special_opts
  @dest_special_opts
end

#errorsObject (readonly)

Since:

  • 2.2.0



18
19
20
# File 'lib/kiba/extend/registry/file_registry_entry.rb', line 18

def errors
  @errors
end

#keyObject (readonly)

Since:

  • 2.2.0



18
19
20
# File 'lib/kiba/extend/registry/file_registry_entry.rb', line 18

def key
  @key
end

#lookup_onObject (readonly)

Since:

  • 2.2.0



18
19
20
# File 'lib/kiba/extend/registry/file_registry_entry.rb', line 18

def lookup_on
  @lookup_on
end

#messageObject (readonly)

Since:

  • 2.2.0



18
19
20
# File 'lib/kiba/extend/registry/file_registry_entry.rb', line 18

def message
  @message
end

#pathObject (readonly)

Since:

  • 2.2.0



18
19
20
# File 'lib/kiba/extend/registry/file_registry_entry.rb', line 18

def path
  @path
end

#src_classObject (readonly)

Since:

  • 2.2.0



18
19
20
# File 'lib/kiba/extend/registry/file_registry_entry.rb', line 18

def src_class
  @src_class
end

#src_optObject (readonly)

Since:

  • 2.2.0



18
19
20
# File 'lib/kiba/extend/registry/file_registry_entry.rb', line 18

def src_opt
  @src_opt
end

#suppliedObject (readonly)

Since:

  • 2.2.0



18
19
20
# File 'lib/kiba/extend/registry/file_registry_entry.rb', line 18

def supplied
  @supplied
end

#tagsObject (readonly)

Since:

  • 2.2.0



18
19
20
# File 'lib/kiba/extend/registry/file_registry_entry.rb', line 18

def tags
  @tags
end

#typeObject (readonly)

Since:

  • 2.2.0



18
19
20
# File 'lib/kiba/extend/registry/file_registry_entry.rb', line 18

def type
  @type
end

#warningsObject (readonly)

Since:

  • 2.2.0



18
19
20
# File 'lib/kiba/extend/registry/file_registry_entry.rb', line 18

def warnings
  @warnings
end

Instance Method Details

#dirObject

Since:

  • 2.2.0



47
# File 'lib/kiba/extend/registry/file_registry_entry.rb', line 47

def dir = path.dirname

#valid?Boolean

Whether the Entry is valid

Returns:

  • (Boolean)

Since:

  • 2.2.0



51
# File 'lib/kiba/extend/registry/file_registry_entry.rb', line 51

def valid? = @valid