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



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

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



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

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)


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

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

#project?Boolean

Returns:

  • (Boolean)


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

def project?
  stereotypes.any?
end

#to_hObject



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

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

#to_sObject



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

def to_s
  logical
end