Class: CommitRange
- Inherits:
-
Struct
- Object
- Struct
- CommitRange
- Defined in:
- lib/git_fame/commit_range.rb
Constant Summary collapse
- SHORT_LENGTH =
7
Instance Attribute Summary collapse
-
#current_branch ⇒ Object
Returns the value of attribute current_branch.
-
#data ⇒ Object
Returns the value of attribute data.
Instance Method Summary collapse
Instance Attribute Details
#current_branch ⇒ Object
Returns the value of attribute current_branch
1 2 3 |
# File 'lib/git_fame/commit_range.rb', line 1 def current_branch @current_branch end |
#data ⇒ Object
Returns the value of attribute data
1 2 3 |
# File 'lib/git_fame/commit_range.rb', line 1 def data @data end |
Instance Method Details
#is_range? ⇒ Boolean
10 11 12 |
# File 'lib/git_fame/commit_range.rb', line 10 def is_range? data.is_a?(Array) end |
#range ⇒ Object
14 15 16 |
# File 'lib/git_fame/commit_range.rb', line 14 def range is_range? ? data : [data] end |
#to_s(short = false) ⇒ Object
4 5 6 7 8 |
# File 'lib/git_fame/commit_range.rb', line 4 def to_s(short = false) @_to_s ||= range.map do |commit| short ? shorten(commit) : commit end.join("..") end |