Class: Array
- Inherits:
-
Object
- Object
- Array
- Defined in:
- lib/git-blame-color/ext/argv.rb,
lib/git-blame-color/ext/array.rb
Constant Summary collapse
- OPTION_FLAGS =
%W{--incremental --show-stats -b -l -t}
- OPTION_NAMES =
%W{incremental show_stats blank_boundary_commits long_hash raw_timestamps}
- OPTIONS =
OPTION_FLAGS.zip(OPTION_NAMES)
Instance Method Summary collapse
- #drop_last(n) ⇒ Object
- #longest_string ⇒ Object
- #longest_string_by_key(key) ⇒ Object
- #longest_string_length ⇒ Object
- #longest_string_length_by_key(key) ⇒ Object
Instance Method Details
#drop_last(n) ⇒ Object
2 3 4 |
# File 'lib/git-blame-color/ext/array.rb', line 2 def drop_last(n) first(length - n) end |
#longest_string ⇒ Object
10 11 12 |
# File 'lib/git-blame-color/ext/array.rb', line 10 def longest_string map(&:to_s).max_by(&:length) end |
#longest_string_by_key(key) ⇒ Object
6 7 8 |
# File 'lib/git-blame-color/ext/array.rb', line 6 def longest_string_by_key(key) map(&key).longest_string end |
#longest_string_length ⇒ Object
14 15 16 |
# File 'lib/git-blame-color/ext/array.rb', line 14 def longest_string_length longest_string.length end |
#longest_string_length_by_key(key) ⇒ Object
18 19 20 |
# File 'lib/git-blame-color/ext/array.rb', line 18 def longest_string_length_by_key(key) longest_string_by_key(key).length end |