Class: RVC::FakeFolder

Inherits:
Object
  • Object
show all
Includes:
InventoryObject
Defined in:
lib/rvc/inventory.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from InventoryObject

#display_info, included, #ls_text, #traverse_one

Constructor Details

#initialize(target, method) ⇒ FakeFolder

Returns a new instance of FakeFolder.



62
63
64
65
# File 'lib/rvc/inventory.rb', line 62

def initialize target, method
  @target = target
  @method = method
end

Class Method Details

.folder?Boolean

Returns:

  • (Boolean)


71
72
73
# File 'lib/rvc/inventory.rb', line 71

def self.folder?
  true
end

Instance Method Details

#childrenObject



67
68
69
# File 'lib/rvc/inventory.rb', line 67

def children
  @target.send @method
end

#eql?(x) ⇒ Boolean

Returns:

  • (Boolean)


79
80
81
82
# File 'lib/rvc/inventory.rb', line 79

def eql? x
  @target == x.instance_variable_get(:@target) &&
    @method == x.instance_variable_get(:@method)
end

#hashObject



84
85
86
# File 'lib/rvc/inventory.rb', line 84

def hash
  @target.hash ^ @method.hash
end

#parentObject



75
76
77
# File 'lib/rvc/inventory.rb', line 75

def parent
  @target
end