Class: EPO::Observer::Source

Inherits:
Struct
  • Object
show all
Defined in:
lib/epo/core/observer.rb

Overview

in EPO, the source of an observation is:

  • a db object able to make a ruby object from a file path

  • a file path

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#dbObject

Returns the value of attribute db

Returns:

  • (Object)

    the current value of db



15
16
17
# File 'lib/epo/core/observer.rb', line 15

def db
  @db
end

#pathObject

Returns the value of attribute path

Returns:

  • (Object)

    the current value of path



15
16
17
# File 'lib/epo/core/observer.rb', line 15

def path
  @path
end

Instance Method Details

#observe {|db.read_file(path)| ... } ⇒ Object

Yields:



16
17
18
# File 'lib/epo/core/observer.rb', line 16

def observe
  yield db.read_file(path)
end