Class: Redmine::Scm::Adapters::Revision

Inherits:
Object
  • Object
show all
Defined in:
lib/redmine/scm/adapters/abstract_adapter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Revision

Returns a new instance of Revision



377
378
379
380
381
382
383
384
385
386
387
388
# File 'lib/redmine/scm/adapters/abstract_adapter.rb', line 377

def initialize(attributes={})
  self.identifier = attributes[:identifier]
  self.scmid      = attributes[:scmid]
  self.name       = attributes[:name] || self.identifier
  self.author     = attributes[:author]
  self.time       = attributes[:time]
  self.message    = attributes[:message] || ""
  self.paths      = attributes[:paths]
  self.revision   = attributes[:revision]
  self.branch     = attributes[:branch]
  self.parents    = attributes[:parents]
end

Instance Attribute Details

#authorObject

Returns the value of attribute author



373
374
375
# File 'lib/redmine/scm/adapters/abstract_adapter.rb', line 373

def author
  @author
end

#branchObject

Returns the value of attribute branch



373
374
375
# File 'lib/redmine/scm/adapters/abstract_adapter.rb', line 373

def branch
  @branch
end

#identifierObject

Returns the value of attribute identifier



373
374
375
# File 'lib/redmine/scm/adapters/abstract_adapter.rb', line 373

def identifier
  @identifier
end

#messageObject

Returns the value of attribute message



373
374
375
# File 'lib/redmine/scm/adapters/abstract_adapter.rb', line 373

def message
  @message
end

#nameObject

Returns the value of attribute name



373
374
375
# File 'lib/redmine/scm/adapters/abstract_adapter.rb', line 373

def name
  @name
end

#parentsObject

Returns the value of attribute parents



373
374
375
# File 'lib/redmine/scm/adapters/abstract_adapter.rb', line 373

def parents
  @parents
end

#pathsObject

Returns the value of attribute paths



373
374
375
# File 'lib/redmine/scm/adapters/abstract_adapter.rb', line 373

def paths
  @paths
end

#revisionObject

Returns the value of attribute revision



373
374
375
# File 'lib/redmine/scm/adapters/abstract_adapter.rb', line 373

def revision
  @revision
end

#scmidObject

Returns the value of attribute scmid



373
374
375
# File 'lib/redmine/scm/adapters/abstract_adapter.rb', line 373

def scmid
  @scmid
end

#timeObject

Returns the value of attribute time



373
374
375
# File 'lib/redmine/scm/adapters/abstract_adapter.rb', line 373

def time
  @time
end

Instance Method Details

#==(other) ⇒ Object



395
396
397
398
399
400
401
402
403
404
405
# File 'lib/redmine/scm/adapters/abstract_adapter.rb', line 395

def ==(other)
  if other.nil?
    false
  elsif scmid.present?
    scmid == other.scmid
  elsif identifier.present?
    identifier == other.identifier
  elsif revision.present?
    revision == other.revision
  end
end

#format_identifierObject

Returns the readable identifier.



391
392
393
# File 'lib/redmine/scm/adapters/abstract_adapter.rb', line 391

def format_identifier
  self.identifier.to_s
end