Class: Svnx::ActionStatus
- Inherits:
-
Object
- Object
- Svnx::ActionStatus
- Includes:
- Singleton
- Defined in:
- lib/svnx/base/action_status.rb
Instance Attribute Summary collapse
-
#stati ⇒ Object
readonly
Returns the value of attribute stati.
Instance Method Summary collapse
- #add_type(str, char) ⇒ Object
-
#initialize ⇒ ActionStatus
constructor
A new instance of ActionStatus.
- #symbol_for(arg) ⇒ Object
Constructor Details
#initialize ⇒ ActionStatus
Returns a new instance of ActionStatus.
12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/svnx/base/action_status.rb', line 12 def initialize @status_to_symbol = Hash.new @stati = Array.new add_type 'added', 'A' add_type 'deleted', 'D' add_type 'modified', 'M' add_type 'replaced', 'R' add_type 'unversioned', '?' add_type 'external', 'X' add_type 'normal', 'q' # actually, X, but in a different column than X for external end |
Instance Attribute Details
#stati ⇒ Object (readonly)
Returns the value of attribute stati.
10 11 12 |
# File 'lib/svnx/base/action_status.rb', line 10 def stati @stati end |
Instance Method Details
#add_type(str, char) ⇒ Object
29 30 31 32 33 34 35 |
# File 'lib/svnx/base/action_status.rb', line 29 def add_type str, char sym = str.to_sym @stati << str [ sym, str, char ].each do |key| @status_to_symbol[key] = sym end end |
#symbol_for(arg) ⇒ Object
25 26 27 |
# File 'lib/svnx/base/action_status.rb', line 25 def symbol_for arg @status_to_symbol[arg] end |