Class: TFSGraph::ProjectStore

Inherits:
Object
  • Object
show all
Extended by:
TFSClient
Defined in:
lib/tfs_graph/project/project_store.rb

Constant Summary

Constants included from TFSClient

TFSClient::InvalidConfig, TFSClient::REQUIRED_KEYS

Class Method Summary collapse

Methods included from TFSClient

endpoint, setup, tfs, tfs=

Class Method Details

.all_cachedObject



21
22
23
# File 'lib/tfs_graph/project/project_store.rb', line 21

def all_cached
  Related.root.outgoing(:projects).options(model: Project).nodes.to_a
end

.cacheObject



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/tfs_graph/project/project_store.rb', line 9

def cache
  projects = tfs.projects.run
  normalized = ProjectNormalizer.normalize_many projects

  normalized.map do |project_attrs|
    project = Project.create project_attrs
    Related::Relationship.create(:projects, Related.root, project)

    project
  end
end

.find_cached(name) ⇒ Object



25
26
27
# File 'lib/tfs_graph/project/project_store.rb', line 25

def find_cached(name)
  all_cached.detect {|p| p.name == name }
end