Class: CodeInventory::JSONFile

Inherits:
Object
  • Object
show all
Defined in:
lib/codeinventory/json_file.rb

Instance Method Summary collapse

Constructor Details

#initialize(json_file) ⇒ JSONFile



5
6
7
# File 'lib/codeinventory/json_file.rb', line 5

def initialize(json_file)
  @projects = JSON.load(json_file)
end

Instance Method Details

#projectsObject



9
10
11
12
13
14
# File 'lib/codeinventory/json_file.rb', line 9

def projects
  if block_given?
    @projects.each { |p| yield p }
  end
  @projects
end