WSNumbatNetworkObject
WSModelObject > WSBaseNetworkObject > WSNumbatNetworkObject
A network using merge version control.
Methods:
- branch
- commit
- commit_reserve
- commits
- current_commit_id
- latest_commit_id
- open_version
- reserve
- revert
- uncommitted_changes?
- unreserve
- update
branch
#branch(commit_id, new_name) ⇒ WSModelObject
EXCHANGE
Branches the network object, creating a new network object.
Parameters
Name | Type(s) | Description |
---|---|---|
commit_id | Integer | The branch is performed from this commit id. |
new_name | String | The new network name. |
Return | WSModelObject |
commit
#commit(comment) ⇒ Integer
EXCHANGE
Commits any changes to the network to the database. Returns the commit ID, or returns nil if there were no changes made and therefore no new commit.
network.commit('This is the comment for my commit')
Parameters
Name | Type(s) | Description |
---|---|---|
comment | String | |
Return | Integer |
commit_reserve
#commit_reserve(comment) ⇒ Integer
EXCHANGE
Performs the same action as commit
, but keeps the network reserved if it was already.
Parameters
Name | Type(s) | Description |
---|---|---|
comment | String | |
Return | Integer |
commits
#commits ⇒ WSCommits
EXCHANGE
Returns the commit history for the network.
Example of printing the number of commits:
commits = network.commits
puts "There have been #{commits.length} commits to this network!"
Example of printing all comments from user 'Badger':
network.commits.each do |commit|
puts \"#{commit.commit_id}: #{commit.comment}\" if commit.user == 'Badger'
end
Parameters
Name | Type(s) | Description |
---|---|---|
Return | WSCommits |
current_commit_id
#current_commit_id ⇒ Integer
EXCHANGE
Returns the commit ID of the local copy of the network. This may not be the most recent commit ID on the server, which is returned by #latest_commit_id
.
Parameters
Name | Type(s) | Description |
---|---|---|
Return | Integer |
latest_commit_id
#latest_commit_id ⇒ Integer
EXCHANGE
Returns the latest commit ID for the network from the server. This may not be the same commit ID as the local copy, which is returned by #current_commit_id
.
Parameters
Name | Type(s) | Description |
---|---|---|
Return | Integer |
open_version
#open_version(commit_id) ⇒ WSOpenNetwork
EXCHANGE
Opens a specific version of the network, from it's commit ID.
Parameters
Name | Type(s) | Description |
---|---|---|
Return | WSOpenNetwork |
reserve
#reserve ⇒ void
EXCHANGE
Reserves the network so no-one else can edit it, and also updates the local copy to the latest version.
revert
#revert ⇒ void
EXCHANGE
Reverts any changes to the network that have not yet been committed. This does not guarantee that the network is up to date, only that any changes made to the local copy have been abandoned.
uncommitted_changes?
#uncommitted_changes? ⇒ Boolean
EXCHANGE
Returns if there are uncommitted changes to the network.
Parameters
Name | Type(s) | Description |
---|---|---|
Return | Boolean |
unreserve
#reserve ⇒ void
EXCHANGE
Cancels any reservation of the network.
update
#update ⇒ Boolean
EXCHANGE
Updates the local copy of the network to the latest version from the server. Not relevant for Standalone databases.
Parameters
Name | Type(s) | Description |
---|---|---|
Return | Boolean | True if this was successful, false if there are conflicts. |