Class: Grit::Status::StatusFile
- Inherits:
-
Object
- Object
- Grit::Status::StatusFile
- Defined in:
- lib/grit/status.rb
Instance Attribute Summary collapse
-
#mode_index ⇒ Object
Returns the value of attribute mode_index.
-
#mode_repo ⇒ Object
Returns the value of attribute mode_repo.
-
#path ⇒ Object
Returns the value of attribute path.
-
#sha_index ⇒ Object
Returns the value of attribute sha_index.
-
#sha_repo ⇒ Object
Returns the value of attribute sha_repo.
-
#stage ⇒ Object
Returns the value of attribute stage.
-
#type ⇒ Object
Returns the value of attribute type.
-
#untracked ⇒ Object
Returns the value of attribute untracked.
Instance Method Summary collapse
- #blob(type = :index) ⇒ Object
-
#initialize(base, hash) ⇒ StatusFile
constructor
A new instance of StatusFile.
Constructor Details
#initialize(base, hash) ⇒ StatusFile
Returns a new instance of StatusFile.
66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/grit/status.rb', line 66 def initialize(base, hash) @base = base @path = hash[:path] @type = hash[:type] @stage = hash[:stage] @mode_index = hash[:mode_index] @mode_repo = hash[:mode_repo] @sha_index = hash[:sha_index] @sha_repo = hash[:sha_repo] @untracked = hash[:untracked] end |
Instance Attribute Details
#mode_index ⇒ Object
Returns the value of attribute mode_index.
61 62 63 |
# File 'lib/grit/status.rb', line 61 def mode_index @mode_index end |
#mode_repo ⇒ Object
Returns the value of attribute mode_repo.
61 62 63 |
# File 'lib/grit/status.rb', line 61 def mode_repo @mode_repo end |
#path ⇒ Object
Returns the value of attribute path.
60 61 62 |
# File 'lib/grit/status.rb', line 60 def path @path end |
#sha_index ⇒ Object
Returns the value of attribute sha_index.
62 63 64 |
# File 'lib/grit/status.rb', line 62 def sha_index @sha_index end |
#sha_repo ⇒ Object
Returns the value of attribute sha_repo.
62 63 64 |
# File 'lib/grit/status.rb', line 62 def sha_repo @sha_repo end |
#stage ⇒ Object
Returns the value of attribute stage.
60 61 62 |
# File 'lib/grit/status.rb', line 60 def stage @stage end |
#type ⇒ Object
Returns the value of attribute type.
60 61 62 |
# File 'lib/grit/status.rb', line 60 def type @type end |
#untracked ⇒ Object
Returns the value of attribute untracked.
60 61 62 |
# File 'lib/grit/status.rb', line 60 def untracked @untracked end |
Instance Method Details
#blob(type = :index) ⇒ Object
78 79 80 81 82 83 84 |
# File 'lib/grit/status.rb', line 78 def blob(type = :index) if type == :repo @base.object(@sha_repo) else @base.object(@sha_index) rescue @base.object(@sha_repo) end end |