Class: ThinkingSphinx::Ports::Read

Inherits:
Object
  • Object
show all
Defined in:
lib/thinking_sphinx/ports/read.rb

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ Read

Returns a new instance of Read.



2
3
4
# File 'lib/thinking_sphinx/ports/read.rb', line 2

def initialize(path)
  @path = path
end

Instance Method Details

#callObject



6
7
8
9
10
# File 'lib/thinking_sphinx/ports/read.rb', line 6

def call
  return {} unless File.exist?(path)

  YAML.load File.read(path)
end