Class: Acorn::SeedGrabber
- Inherits:
-
Object
- Object
- Acorn::SeedGrabber
- Defined in:
- lib/acorn/seed_grabber.rb
Instance Attribute Summary collapse
-
#dir_name ⇒ Object
Returns the value of attribute dir_name.
-
#seed_names ⇒ Object
Returns the value of attribute seed_names.
Instance Method Summary collapse
- #grab ⇒ Object
-
#initialize(dir_name, seed_names) ⇒ SeedGrabber
constructor
A new instance of SeedGrabber.
Constructor Details
#initialize(dir_name, seed_names) ⇒ SeedGrabber
Returns a new instance of SeedGrabber.
4 5 6 7 |
# File 'lib/acorn/seed_grabber.rb', line 4 def initialize dir_name, seed_names self.dir_name = dir_name self.seed_names = seed_names end |
Instance Attribute Details
#dir_name ⇒ Object
Returns the value of attribute dir_name.
3 4 5 |
# File 'lib/acorn/seed_grabber.rb', line 3 def dir_name @dir_name end |
#seed_names ⇒ Object
Returns the value of attribute seed_names.
3 4 5 |
# File 'lib/acorn/seed_grabber.rb', line 3 def seed_names @seed_names end |
Instance Method Details
#grab ⇒ Object
9 10 11 12 13 14 |
# File 'lib/acorn/seed_grabber.rb', line 9 def grab seed_names.map do |seed_name| file_name = dir_name + seed_name.to_s + '.json' JSON.load open file_name end end |