Class: PVN::Diff::Change

Inherits:
Object
  • Object
show all
Includes:
Loggable
Defined in:
lib/pvn/diff/change.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(revision, action) ⇒ Change

Returns a new instance of Change.



16
17
18
19
# File 'lib/pvn/diff/change.rb', line 16

def initialize revision, action
  @revision = to_revision(revision)
  @action = action.kind_of?(SVNx::Action) || SVNx::Action.new(action)
end

Instance Attribute Details

#actionObject (readonly)

Returns the value of attribute action.



14
15
16
# File 'lib/pvn/diff/change.rb', line 14

def action
  @action
end

#revisionObject (readonly)

Returns the value of attribute revision.



13
14
15
# File 'lib/pvn/diff/change.rb', line 13

def revision
  @revision
end

Instance Method Details

#to_revision(rev) ⇒ Object



21
22
23
24
25
# File 'lib/pvn/diff/change.rb', line 21

def to_revision rev
  # or should we convert this to Revision::Argument, and @revisions is
  # Revision::Range?
  rev.kind_of?(Fixnum) ? rev.to_s : rev
end

#to_sObject



27
28
29
# File 'lib/pvn/diff/change.rb', line 27

def to_s
  inspect
end