Class: Avm::Scms::CommitInfo

Inherits:
Object
  • Object
show all
Defined in:
lib/avm/scms/commit_info.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.assert(source) ⇒ Avm::Scms::CommitInfo

Parameters:

Returns:



11
12
13
14
15
16
17
18
# File 'lib/avm/scms/commit_info.rb', line 11

def assert(source)
  return source if source.is_a?(self)
  return new if source.nil?
  return new.message(source) if source.is_a?(::String)
  return assert(source.call) if source.is_a?(::Proc)

  raise "Unmapped assertion for #{source.to_debug}"
end

Instance Method Details

#to_sObject



26
27
28
29
30
# File 'lib/avm/scms/commit_info.rb', line 26

def to_s
  self.class.name.demodulize + '[' +
    %w[fixup message].map { |m| [m, send(m)] }.reject { |m| m[1].blank? }
      .map { |m| m.join(': ') }.join(',') + ']'
end