Class: SVNx::Status::Entry
Instance Attribute Summary collapse
-
#action ⇒ Object
readonly
Returns the value of attribute action.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#status_revision ⇒ Object
readonly
Returns the value of attribute status_revision.
Instance Method Summary collapse
-
#initialize(args = Hash.new) ⇒ Entry
constructor
A new instance of Entry.
- #set_from_element(elmt) ⇒ Object
- #set_from_xml(xmldoc) ⇒ Object
- #to_s ⇒ Object
Methods inherited from Entry
#get_attribute, #get_element_text, #set_attr_var, #set_elmt_var, #set_var
Constructor Details
Instance Attribute Details
#action ⇒ Object (readonly)
Returns the value of attribute action.
15 16 17 |
# File 'lib/svnx/status/entry.rb', line 15 def action @action end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
13 14 15 |
# File 'lib/svnx/status/entry.rb', line 13 def path @path end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
12 13 14 |
# File 'lib/svnx/status/entry.rb', line 12 def status @status end |
#status_revision ⇒ Object (readonly)
Returns the value of attribute status_revision.
14 15 16 |
# File 'lib/svnx/status/entry.rb', line 14 def status_revision @status_revision end |
Instance Method Details
#set_from_element(elmt) ⇒ Object
35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/svnx/status/entry.rb', line 35 def set_from_element elmt set_attr_var elmt, 'path' wcstatus = elmt.elements['wc-status'] @status = wcstatus.attributes['item'] @status_revision = wcstatus.attributes['revision'] if commit = wcstatus.elements['commit'] @commit_revision = commit.attributes['revision'] else @commit_revision = nil end end |
#set_from_xml(xmldoc) ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/svnx/status/entry.rb', line 22 def set_from_xml xmldoc stelmt = xmldoc.elements['status'] tgt = stelmt.elements['target'] set_attr_var tgt, 'path' if entry = tgt.elements['entry'] set_from_element entry else @status = "unchanged" end end |
#to_s ⇒ Object
49 50 51 |
# File 'lib/svnx/status/entry.rb', line 49 def to_s "path: #{@path}; status: #{@status}" end |