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)


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

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

#read_file(file) ⇒ String

:reek:UtilityFunction

Parameters:

  • file (String)

Returns:

  • (String)


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

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