Class: SimpleHdGraph::Reader

Inherits:
Object
  • Object
show all
Defined in:
lib/simple-hd-graph/reader.rb

Instance Method Summary collapse

Instance Method Details

#read_dir(dir) ⇒ String

Parameters:

  • dir (String)

Returns:

  • (String)


15
16
17
18
19
# File 'lib/simple-hd-graph/reader.rb', line 15

def read_dir(dir)
  Dir.glob("#{dir}/**/*.{yml,yaml}").map { |file|
    read_file(file)
  }.join("---\n")
end

#read_file(file) ⇒ String

Parameters:

  • file (String)

Returns:

  • (String)


7
8
9
# File 'lib/simple-hd-graph/reader.rb', line 7

def read_file(file)
  File.read(file)
end