Class: OrgMode::Loader

Inherits:
Object
  • Object
show all
Defined in:
lib/org_mode/loader.rb

Class Method Summary collapse

Class Method Details

.load_and_parse_file(path) ⇒ Object

Public: loads and parse a file

Returns OrgMode::File



13
14
15
16
# File 'lib/org_mode/loader.rb', line 13

def self.load_and_parse_file path
  f = File.open(path)
  OrgMode::FileParser.parse(f.read)
end

.load_and_parse_files(paths) ⇒ Object

Public: loads and parses multiple files

Returns OrgMode::FileCollection



5
6
7
8
# File 'lib/org_mode/loader.rb', line 5

def self.load_and_parse_files paths
  org_mode_files = paths.map {|f| load_and_parse_file(f) } 
  OrgMode::FileCollection.new(org_mode_files)
end