Class: Acorn::SeedGrabber

Inherits:
Object
  • Object
show all
Defined in:
lib/acorn/seed_grabber.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_nameObject

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_namesObject

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

#grabObject



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