Class: Symbol
Instance Method Summary collapse
-
#to_hg_int ⇒ Object
Converts the symbol to an integer used for tracking the state of files in the dir_state.
-
#to_hg_letter ⇒ Object
Converts the symbol to the letter it corresponds to.
- #to_proc ⇒ Object
Instance Method Details
#to_hg_int ⇒ Object
Converts the symbol to an integer used for tracking the state of files in the dir_state.
887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 |
# File 'lib/amp/support/support.rb', line 887 def to_hg_int case self when :normal, :dirty 110 # "n".ord when :untracked 63 # "?".ord when :added 97 # "a".ord when :removed 114 # "r".ord when :merged 109 # "m".ord else raise "No known hg value for #{self}" end end |
#to_hg_letter ⇒ Object
Converts the symbol to the letter it corresponds to
905 906 907 |
# File 'lib/amp/support/support.rb', line 905 def to_hg_letter to_hg_int.chr end |
#to_proc ⇒ Object
909 910 911 912 913 |
# File 'lib/amp/support/support.rb', line 909 def to_proc proc do |arg| arg.send self end end |