Class: Svnx::Log::EntryPath
- Inherits:
-
Object
- Object
- Svnx::Log::EntryPath
- Includes:
- Comparable
- Defined in:
- lib/svnx/log/entrypath.rb
Instance Attribute Summary collapse
-
#action ⇒ Object
readonly
Returns the value of attribute action.
-
#kind ⇒ Object
readonly
Returns the value of attribute kind.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#prop_mods ⇒ Object
readonly
Returns the value of attribute prop_mods.
-
#text_mods ⇒ Object
readonly
Returns the value of attribute text_mods.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
- #attribute_value(xmlelement, attrname, meth = nil) ⇒ Object
-
#initialize(attr: nil, kind: nil, action: nil, name: nil, prop_mods: nil, text_mods: nil) ⇒ EntryPath
constructor
A new instance of EntryPath.
- #inspect ⇒ Object
- #match?(action, filter) ⇒ Boolean
- #to_s ⇒ Object
Constructor Details
#initialize(attr: nil, kind: nil, action: nil, name: nil, prop_mods: nil, text_mods: nil) ⇒ EntryPath
Returns a new instance of EntryPath.
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/svnx/log/entrypath.rb', line 17 def initialize attr: nil, kind: nil, action: nil, name: nil, prop_mods: nil, text_mods: nil if attr @kind = attribute_value attr, 'kind' @action = Svnx::Action.new(attribute_value attr, 'action') @name = attr.text @prop_mods = "true" == attribute_value(attr, 'prop-mods') @text_mods = "true" == attribute_value(attr, 'text-mods') else @kind = kind @action = action @name = name @prop_mods = prop_mods @text_mods = text_mods end end |
Instance Attribute Details
#action ⇒ Object (readonly)
Returns the value of attribute action.
15 16 17 |
# File 'lib/svnx/log/entrypath.rb', line 15 def action @action end |
#kind ⇒ Object (readonly)
Returns the value of attribute kind.
15 16 17 |
# File 'lib/svnx/log/entrypath.rb', line 15 def kind @kind end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
15 16 17 |
# File 'lib/svnx/log/entrypath.rb', line 15 def name @name end |
#prop_mods ⇒ Object (readonly)
Returns the value of attribute prop_mods.
15 16 17 |
# File 'lib/svnx/log/entrypath.rb', line 15 def prop_mods @prop_mods end |
#text_mods ⇒ Object (readonly)
Returns the value of attribute text_mods.
15 16 17 |
# File 'lib/svnx/log/entrypath.rb', line 15 def text_mods @text_mods end |
Instance Method Details
#<=>(other) ⇒ Object
41 42 43 |
# File 'lib/svnx/log/entrypath.rb', line 41 def <=> other name <=> other.name end |
#attribute_value(xmlelement, attrname, meth = nil) ⇒ Object
49 50 51 52 |
# File 'lib/svnx/log/entrypath.rb', line 49 def attribute_value xmlelement, attrname, meth = nil value = xmlelement[attrname.to_s] meth ? value.send(meth) : value end |
#inspect ⇒ Object
37 38 39 |
# File 'lib/svnx/log/entrypath.rb', line 37 def inspect to_s end |
#match?(action, filter) ⇒ Boolean
45 46 47 |
# File 'lib/svnx/log/entrypath.rb', line 45 def match? action, filter @action.to_s == action.to_s && @name.start_with?(filter) end |
#to_s ⇒ Object
33 34 35 |
# File 'lib/svnx/log/entrypath.rb', line 33 def to_s @name end |