Class: Avm::Launcher::Paths::Logical

Inherits:
Object
  • Object
show all
Defined in:
lib/avm/launcher/paths/logical.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.from_h(context, hash) ⇒ Object



14
15
16
17
# File 'lib/avm/launcher/paths/logical.rb', line 14

def from_h(context, hash)
  parent_path = hash[:parent_path] ? from_h(context, hash[:parent_path]) : nil
  new(context, parent_path, hash[:real], hash[:logical])
end

Instance Method Details

#childrenObject



38
39
40
41
42
43
44
45
46
47
48
# File 'lib/avm/launcher/paths/logical.rb', line 38

def children
  r = []
  Dir.entries(warped).each do |c|
    c_path = ::File.join(warped, c)
    next unless ::File.directory?(c_path)
    next if c.start_with?('.')

    r << build_child(c)
  end
  r
end

#included?Boolean

Returns:

  • (Boolean)


50
51
52
# File 'lib/avm/launcher/paths/logical.rb', line 50

def included?
  context.settings.excluded_paths.exclude?(logical)
end

#project?Boolean

Returns:

  • (Boolean)


34
35
36
# File 'lib/avm/launcher/paths/logical.rb', line 34

def project?
  stereotypes.any?
end

#to_hObject



30
31
32
# File 'lib/avm/launcher/paths/logical.rb', line 30

def to_h
  { logical: logical, real: real.to_s, parent_path: parent_path&.to_h }
end

#to_sObject



26
27
28
# File 'lib/avm/launcher/paths/logical.rb', line 26

def to_s
  logical
end