Class: Mercurial::ChangedFile
- Inherits:
-
Object
- Object
- Mercurial::ChangedFile
- Defined in:
- lib/mercurial-ruby/changed_file.rb
Instance Attribute Summary collapse
-
#initial_name ⇒ Object
readonly
Returns the value of attribute initial_name.
-
#mode_letter ⇒ Object
Returns the value of attribute mode_letter.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #added? ⇒ Boolean
- #copied? ⇒ Boolean
- #deleted? ⇒ Boolean
-
#initialize(opts = {}) ⇒ ChangedFile
constructor
A new instance of ChangedFile.
- #mode ⇒ Object
- #modified? ⇒ Boolean
- #moved? ⇒ Boolean
Constructor Details
#initialize(opts = {}) ⇒ ChangedFile
Returns a new instance of ChangedFile.
8 9 10 11 12 |
# File 'lib/mercurial-ruby/changed_file.rb', line 8 def initialize(opts={}) @initial_name = opts[:initial_name] @name = opts[:name] @mode_letter = opts[:mode] end |
Instance Attribute Details
#initial_name ⇒ Object (readonly)
Returns the value of attribute initial_name.
5 6 7 |
# File 'lib/mercurial-ruby/changed_file.rb', line 5 def initial_name @initial_name end |
#mode_letter ⇒ Object
Returns the value of attribute mode_letter.
6 7 8 |
# File 'lib/mercurial-ruby/changed_file.rb', line 6 def mode_letter @mode_letter end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/mercurial-ruby/changed_file.rb', line 5 def name @name end |
Instance Method Details
#added? ⇒ Boolean
26 27 28 |
# File 'lib/mercurial-ruby/changed_file.rb', line 26 def added? mode == :add end |
#copied? ⇒ Boolean
18 19 20 |
# File 'lib/mercurial-ruby/changed_file.rb', line 18 def copied? mode == :copy end |
#deleted? ⇒ Boolean
22 23 24 |
# File 'lib/mercurial-ruby/changed_file.rb', line 22 def deleted? mode == :delete end |
#mode ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/mercurial-ruby/changed_file.rb', line 34 def mode case mode_letter when 'A' :add when 'D' :delete when 'C' :copy when 'R' :move else :edit end end |
#modified? ⇒ Boolean
30 31 32 |
# File 'lib/mercurial-ruby/changed_file.rb', line 30 def modified? mode == :edit end |
#moved? ⇒ Boolean
14 15 16 |
# File 'lib/mercurial-ruby/changed_file.rb', line 14 def moved? mode == :move end |