Class: SVNx::Status::Entry

Inherits:
Entry
  • Object
show all
Defined in:
lib/svnx/status/entry.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Entry

#get_attribute, #get_element_text, #set_attr_var, #set_elmt_var, #set_from_xml, #set_var

Constructor Details

#initialize(args) ⇒ Entry

Returns a new instance of Entry.



17
18
19
20
# File 'lib/svnx/status/entry.rb', line 17

def initialize args
  super
  @action = SVNx::Action.new @status
end

Instance Attribute Details

#actionObject (readonly)

Returns the value of attribute action.



14
15
16
# File 'lib/svnx/status/entry.rb', line 14

def action
  @action
end

#commit_revisionObject (readonly)

Returns the value of attribute commit_revision.



15
16
17
# File 'lib/svnx/status/entry.rb', line 15

def commit_revision
  @commit_revision
end

#pathObject (readonly)

Returns the value of attribute path.



12
13
14
# File 'lib/svnx/status/entry.rb', line 12

def path
  @path
end

#statusObject (readonly)

Returns the value of attribute status.



11
12
13
# File 'lib/svnx/status/entry.rb', line 11

def status
  @status
end

#status_revisionObject (readonly)

Returns the value of attribute status_revision.



13
14
15
# File 'lib/svnx/status/entry.rb', line 13

def status_revision
  @status_revision
end

Instance Method Details

#set_from_element(elmt) ⇒ Object



22
23
24
25
26
27
28
29
30
31
# File 'lib/svnx/status/entry.rb', line 22

def set_from_element elmt
  set_attr_var elmt, 'path'

  wcstatus = elmt.elements['wc-status']
  @status = wcstatus.attributes['item']
  @status_revision = wcstatus.attributes['revision']
  
  commit = wcstatus.elements['commit']
  @commit_revision = commit && commit.attributes['revision']
end

#to_sObject



33
34
35
# File 'lib/svnx/status/entry.rb', line 33

def to_s
  "path: #{@path}; status: #{@status}"
end