Class: Eyemask::Core::Loader
- Inherits:
-
Object
- Object
- Eyemask::Core::Loader
- Defined in:
- lib/eyemask/core/loader.rb
Instance Method Summary collapse
- #contents ⇒ Object
- #document ⇒ Object
- #done ⇒ Object
-
#initialize(options = {}) ⇒ Loader
constructor
A new instance of Loader.
- #load(uri, data) ⇒ Object
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 = @contents = [] end |
Instance Method Details
#contents ⇒ Object
30 31 32 |
# File 'lib/eyemask/core/loader.rb', line 30 def contents @contents.sort{|a, b| a["uri"] <=> b["uri"] } end |
#document ⇒ Object
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 |
#done ⇒ Object
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 |