Class: TFSGraph::BranchStore
- Inherits:
-
AbstractStore
- Object
- AbstractStore
- TFSGraph::BranchStore
- Defined in:
- lib/tfs_graph/branch/branch_store.rb
Constant Summary collapse
- LIMIT =
1000
Constants included from StoreHelpers
Constants included from TFSClient
TFSClient::InvalidConfig, TFSClient::REQUIRED_KEYS
Instance Method Summary collapse
- #cache(attrs) ⇒ Object
- #fetch_since_date(date) ⇒ Object
- #fetch_since_last_update ⇒ Object
-
#initialize(project) ⇒ BranchStore
constructor
A new instance of BranchStore.
Methods inherited from AbstractStore
#cache_all, #fetch_all, #fetch_and_cache
Methods included from StoreHelpers
#flush_all, #last_updated_on, #mark_as_updated
Methods included from TFSHelpers
#base_username, #branch_base, #branch_path_to_name, #branch_project, #odata_path_to_server_path, #scrub_changeset, #server_path_to_odata_path
Methods included from TFSClient
#endpoint, #setup, #tfs, #tfs=
Constructor Details
#initialize(project) ⇒ BranchStore
Returns a new instance of BranchStore.
10 11 12 |
# File 'lib/tfs_graph/branch/branch_store.rb', line 10 def initialize(project) @project = project end |
Instance Method Details
#cache(attrs) ⇒ Object
22 23 24 25 26 27 28 29 |
# File 'lib/tfs_graph/branch/branch_store.rb', line 22 def cache(attrs) branch = RepositoryRegistry.branch_repository.build attrs # add_branch action runs save! on branch @project.add_branch(branch) branch end |
#fetch_since_date(date) ⇒ Object
18 19 20 |
# File 'lib/tfs_graph/branch/branch_store.rb', line 18 def fetch_since_date(date) normalize root_query.where("DateCreated gt DateTime'#{date}'").run end |
#fetch_since_last_update ⇒ Object
14 15 16 |
# File 'lib/tfs_graph/branch/branch_store.rb', line 14 def fetch_since_last_update fetch_since_date(@project.last_updated.iso8601) end |