Class: FeaturedImage::Size
- Inherits:
-
Object
- Object
- FeaturedImage::Size
- Defined in:
- lib/featuredimage/finder.rb
Instance Attribute Summary collapse
-
#height ⇒ Object
Returns the value of attribute height.
-
#width ⇒ Object
Returns the value of attribute width.
Instance Method Summary collapse
- #<(size) ⇒ Object
- #aspect ⇒ Object
-
#initialize(width, height) ⇒ Size
constructor
A new instance of Size.
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
#height ⇒ Object
Returns the value of attribute height.
173 174 175 |
# File 'lib/featuredimage/finder.rb', line 173 def height @height end |
#width ⇒ Object
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 |
#aspect ⇒ Object
179 180 181 |
# File 'lib/featuredimage/finder.rb', line 179 def aspect width.to_f / height.to_f # ;-) end |