Class: Eyemask::Core::Loader

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

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Loader

Returns a new instance of Loader.



6
7
8
9
# File 'lib/eyemask/core/loader.rb', line 6

def initialize(options={})
  @options = options
  @contents = []
end

Instance Method Details

#contentsObject



30
31
32
# File 'lib/eyemask/core/loader.rb', line 30

def contents
  @contents.sort{|a, b| a["uri"] <=> b["uri"] }
end

#documentObject



19
20
21
22
23
24
25
26
27
28
# File 'lib/eyemask/core/loader.rb', line 19

def document
  doc = {}
  doc["contents"] = contents
  doc["title"] = @options[:title]
  doc["subtitle"] = @options[:subtitle]
  doc["authors"] = @options[:authors]
  doc["logo"] = @options[:logo]
  doc["params"] = @options[:params]
  doc
end

#doneObject



15
16
17
# File 'lib/eyemask/core/loader.rb', line 15

def done
  # DO NOTHING, HERE AS A HOOK
end

#load(uri, data) ⇒ Object



11
12
13
# File 'lib/eyemask/core/loader.rb', line 11

def load(uri, data)
  @contents.concat(to_elements(uri, data))
end