Class: Svnx::Info::Entry

Inherits:
Base::Entry show all
Defined in:
lib/svnx/info/entry.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base::Entry

#attribute_value, #element_text, #initialize, #set_attr_var, #set_attr_vars, #set_elmt_var, #set_elmt_vars, #set_var

Constructor Details

This class inherits a constructor from Svnx::Base::Entry

Instance Attribute Details

#kindObject (readonly)

Returns the value of attribute kind.



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

def kind
  @kind
end

#pathObject (readonly)

Returns the value of attribute path.



16
17
18
# File 'lib/svnx/info/entry.rb', line 16

def path
  @path
end

#relative_urlObject (readonly)

Returns the value of attribute relative_url.



19
20
21
# File 'lib/svnx/info/entry.rb', line 19

def relative_url
  @relative_url
end

#revisionObject (readonly)

Returns the value of attribute revision.



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

def revision
  @revision
end

#rootObject (readonly)

Returns the value of attribute root.



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

def root
  @root
end

#urlObject (readonly)

Returns the value of attribute url.



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

def url
  @url
end

#wc_rootObject (readonly)

Returns the value of attribute wc_root.



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

def wc_root
  @wc_root
end

Instance Method Details

#set_from_element(elmt) ⇒ Object



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/svnx/info/entry.rb', line 21

def set_from_element elmt
  set_attr_vars elmt, 'kind', 'path', 'revision'
  set_elmt_var  elmt, 'url'
  if relurl = elmt.at_xpath('relative-url')
    @relative_url = relurl.text
  end
  
  repo = elmt.at_xpath 'repository'
  set_elmt_var repo, 'root'

  @wc_root = nil
  if wcinfo = elmt.at_xpath('wc-info')
    if wcroot = wcinfo.at_xpath('wcroot-abspath')
      @wc_root = wcroot.text
    end
  end
end