Class: Avm::Launcher::Paths::Logical
- Inherits:
-
Object
- Object
- Avm::Launcher::Paths::Logical
- Includes:
- Comparable, EacRubyUtils::SimpleCache
- Defined in:
- lib/avm/launcher/paths/logical.rb
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
Returns the value of attribute context.
-
#logical ⇒ Object
readonly
Returns the value of attribute logical.
-
#parent_path ⇒ Object
readonly
Returns the value of attribute parent_path.
-
#real ⇒ Object
readonly
Returns the value of attribute real.
Class Method Summary collapse
Instance Method Summary collapse
- #<=>(other) ⇒ Object
- #children ⇒ Object
- #included? ⇒ Boolean
-
#initialize(context, parent_path, real, logical) ⇒ Logical
constructor
A new instance of Logical.
- #project? ⇒ Boolean
- #to_h ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(context, parent_path, real, logical) ⇒ Logical
Returns a new instance of Logical.
22 23 24 25 26 27 |
# File 'lib/avm/launcher/paths/logical.rb', line 22 def initialize(context, parent_path, real, logical) @context = context @parent_path = parent_path @real = ::Avm::Launcher::Paths::Real.new(real) @logical = logical end |
Instance Attribute Details
#context ⇒ Object (readonly)
Returns the value of attribute context.
20 21 22 |
# File 'lib/avm/launcher/paths/logical.rb', line 20 def context @context end |
#logical ⇒ Object (readonly)
Returns the value of attribute logical.
20 21 22 |
# File 'lib/avm/launcher/paths/logical.rb', line 20 def logical @logical end |
#parent_path ⇒ Object (readonly)
Returns the value of attribute parent_path.
20 21 22 |
# File 'lib/avm/launcher/paths/logical.rb', line 20 def parent_path @parent_path end |
#real ⇒ Object (readonly)
Returns the value of attribute real.
20 21 22 |
# File 'lib/avm/launcher/paths/logical.rb', line 20 def real @real end |
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
#<=>(other) ⇒ Object
29 30 31 |
# File 'lib/avm/launcher/paths/logical.rb', line 29 def <=>(other) [logical, real] <=> [other.logical, other.real] end |
#children ⇒ Object
45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/avm/launcher/paths/logical.rb', line 45 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
57 58 59 |
# File 'lib/avm/launcher/paths/logical.rb', line 57 def included? !context.settings.excluded_paths.include?(logical) end |
#project? ⇒ Boolean
41 42 43 |
# File 'lib/avm/launcher/paths/logical.rb', line 41 def project? stereotypes.any? end |
#to_h ⇒ Object
37 38 39 |
# File 'lib/avm/launcher/paths/logical.rb', line 37 def to_h { logical: logical, real: real.to_s, parent_path: parent_path ? parent_path.to_h : nil } end |
#to_s ⇒ Object
33 34 35 |
# File 'lib/avm/launcher/paths/logical.rb', line 33 def to_s logical end |