Class: Driskell::Listen::Adapter::SimulatedDarwin::FakeEvent

Inherits:
Object
  • Object
show all
Defined in:
lib/driskell-listen/adapter/simulated_darwin.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(watched_dir, event) ⇒ FakeEvent



13
14
15
16
17
18
19
# File 'lib/driskell-listen/adapter/simulated_darwin.rb', line 13

def initialize(watched_dir, event)
  # NOTE: avoid using event.absolute_name since new API
  # will need to have a custom recursion implemented
  # to properly match events to configured directories
  @real_path = full_path(event).relative_path_from(watched_dir)
  @dir = "#{Pathname(watched_dir) + dir_for_event(event, @real_path)}/"
end

Instance Attribute Details

#dirObject (readonly)

Returns the value of attribute dir.



11
12
13
# File 'lib/driskell-listen/adapter/simulated_darwin.rb', line 11

def dir
  @dir
end

Instance Method Details

#real_pathObject



21
22
23
# File 'lib/driskell-listen/adapter/simulated_darwin.rb', line 21

def real_path
  @real_path.to_s
end