class TFSGraph::Changeset
Constants
- SCHEMA
Public Instance Methods
<=>(other)
click to toggle source
# File lib/tfs_graph/changeset.rb, line 22 def <=>(other) id <=> other.id end
add_child(changeset)
click to toggle source
# File lib/tfs_graph/changeset.rb, line 53 def add_child(changeset) @repo.relate(:child, self.db_object, changeset.db_object) end
as_json(options={})
click to toggle source
Calls superclass method
# File lib/tfs_graph/changeset.rb, line 82 def as_json(options={}) results = super [:merges_ids, :merged_ids].each do |key| results[key] = self.send key end results end
base?()
click to toggle source
# File lib/tfs_graph/changeset.rb, line 43 def base? @parent == 0 || @parent == @merge_parent end
branch()
click to toggle source
# File lib/tfs_graph/changeset.rb, line 63 def branch @repo.get_nodes(db_object, :incoming, :changesets, Branch).first end
created()
click to toggle source
# File lib/tfs_graph/changeset.rb, line 47 def created return nil unless @created return @created unless @created.is_a? String @created = Time.parse @created end
eql?(other)
click to toggle source
override for the & (intersect) operator
# File lib/tfs_graph/changeset.rb, line 27 def eql?(other) other.is_a?(self.class) && other == self end
formatted_created()
click to toggle source
# File lib/tfs_graph/changeset.rb, line 67 def formatted_created created.strftime("%m/%d/%Y") end
hash()
click to toggle source
# File lib/tfs_graph/changeset.rb, line 31 def hash @internal_id.hash end
id()
click to toggle source
# File lib/tfs_graph/changeset.rb, line 35 def id @id.to_i unless @id.nil? end
merge?()
click to toggle source
# File lib/tfs_graph/changeset.rb, line 39 def merge? !base? && @merge_parent != 0 end
next()
click to toggle source
# File lib/tfs_graph/changeset.rb, line 57 def next child = @repo.get_nodes(db_object, :outgoing, :child, self.class).first raise StopIteration unless child child end