class Dsfu::Size
Attributes
height[R]
width[R]
Public Class Methods
all()
click to toggle source
# File lib/dsfu/size.rb, line 11 def all @@sizes end
new(width, height)
click to toggle source
# File lib/dsfu/size.rb, line 16 def initialize(width, height) @width, @height = width.to_f, height.to_f end
Public Instance Methods
<=>(other)
click to toggle source
# File lib/dsfu/size.rb, line 20 def <=>(other) (width * height) <=> (other.width * other.height) end
square?()
click to toggle source
# File lib/dsfu/size.rb, line 24 def square? width == height end
strip?()
click to toggle source
# File lib/dsfu/size.rb, line 28 def strip? width * 6 < height || width > height * 6 end