lib/remedy/size.rb in remedy-0.3.1 vs lib/remedy/size.rb in remedy-0.4.0
- old
+ new
@@ -9,10 +9,14 @@
end
@dimensions = new_dimensions
end
attr_accessor :dimensions
+ def self.zero
+ self.new([0,0])
+ end
+
def - other_size
if other_size.respond_to? :length then
self.class.new subtract(other_size)
else
self.class.new deduct(other_size)
@@ -39,14 +43,16 @@
end
def rows
dimensions[0]
end
+ alias_method :height, :rows
def cols
dimensions[1]
end
- alias :columns :cols
+ alias_method :columns, :cols
+ alias_method :width, :cols
def [] index
dimensions[index]
end