Class: Bereshit::Loader
- Inherits:
-
Object
- Object
- Bereshit::Loader
- Defined in:
- lib/bereshit.rb
Overview
Genesis file loader
Instance Attribute Summary collapse
-
#file ⇒ Object
Returns the value of attribute file.
-
#lines ⇒ Object
Returns the value of attribute lines.
Instance Method Summary collapse
-
#initialize(file = '') ⇒ Loader
constructor
A new instance of Loader.
Constructor Details
#initialize(file = '') ⇒ Loader
Returns a new instance of Loader.
78 79 80 81 82 83 84 85 |
# File 'lib/bereshit.rb', line 78 def initialize(file='') self.file = file self.lines = [] file = File.read(File.dirname(__FILE__) << "/" + file) return self.lines = JSON.parse(file) #File.open(File.dirname(__FILE__) << '/sermon.txt').each_line do |line| puts line end |
Instance Attribute Details
#file ⇒ Object
Returns the value of attribute file.
76 77 78 |
# File 'lib/bereshit.rb', line 76 def file @file end |
#lines ⇒ Object
Returns the value of attribute lines.
76 77 78 |
# File 'lib/bereshit.rb', line 76 def lines @lines end |