Class: FeaturedImage::Size

Inherits:
Object
  • Object
show all
Defined in:
lib/featuredimage/finder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(width, height) ⇒ Size

Returns a new instance of Size.



175
176
177
# File 'lib/featuredimage/finder.rb', line 175

def initialize(width, height)
	@width, @height = width, height
end

Instance Attribute Details

#heightObject

Returns the value of attribute height.



173
174
175
# File 'lib/featuredimage/finder.rb', line 173

def height
  @height
end

#widthObject

Returns the value of attribute width.



173
174
175
# File 'lib/featuredimage/finder.rb', line 173

def width
  @width
end

Instance Method Details

#<(size) ⇒ Object



183
184
185
# File 'lib/featuredimage/finder.rb', line 183

def <(size)
	@width * @height < size.width * size.height ? true : false
end

#aspectObject



179
180
181
# File 'lib/featuredimage/finder.rb', line 179

def aspect
	width.to_f / height.to_f # ;-)
end