Class: PhotoUtils::Frame
- Inherits:
-
Object
- Object
- PhotoUtils::Frame
- Defined in:
- lib/photo_utils/frame.rb
Overview
Instance Attribute Summary collapse
-
#height ⇒ Object
Returns the value of attribute height.
-
#width ⇒ Object
Returns the value of attribute width.
Instance Method Summary collapse
- #diagonal ⇒ Object
-
#initialize(height, width) ⇒ Frame
constructor
A new instance of Frame.
- #inspect ⇒ Object
- #to_s(format = :metric) ⇒ Object
Constructor Details
Instance Attribute Details
#height ⇒ Object
Returns the value of attribute height.
7 8 9 |
# File 'lib/photo_utils/frame.rb', line 7 def height @height end |
#width ⇒ Object
Returns the value of attribute width.
8 9 10 |
# File 'lib/photo_utils/frame.rb', line 8 def width @width end |
Instance Method Details
#diagonal ⇒ Object
29 30 31 32 |
# File 'lib/photo_utils/frame.rb', line 29 def diagonal d = Math.sqrt((@height ** 2) + (@width ** 2)) Length.new(d) end |
#inspect ⇒ Object
17 18 19 |
# File 'lib/photo_utils/frame.rb', line 17 def inspect "<#{self.class} height=#{@height.inspect} width=#{@width.inspect}>" end |