We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5ee22e3 commit 7b56ee5Copy full SHA for 7b56ee5
lib/remedy/partial.rb
@@ -27,16 +27,17 @@ def last
27
lines.last
28
end
29
30
- def length
+ def height
31
lines.length
32
33
+ alias_method :length, :height
34
35
def width
- @width ||= lines.max{|line| line.length }.length
36
+ lines.map{|line| line.length }.max
37
38
39
def size
- Size.new length, width
40
+ Size.new height, width
41
42
43
def to_a
lib/remedy/size.rb
@@ -45,11 +45,13 @@ def fits_into? size_to_fit_into
45
def rows
46
dimensions[0]
47
48
+ alias_method :height, :rows
49
50
def cols
51
dimensions[1]
52
- alias :columns :cols
53
+ alias_method :columns, :cols
54
+ alias_method :width, :cols
55
56
def [] index
57
dimensions[index]
0 commit comments