Class: WhirledPeas::Graphics::ContentDimensions
- Inherits:
-
Object
- Object
- WhirledPeas::Graphics::ContentDimensions
- Defined in:
- lib/whirled_peas/graphics/content_dimensions.rb
Instance Attribute Summary collapse
-
#outer_height ⇒ Object
readonly
Returns the value of attribute outer_height.
-
#outer_width ⇒ Object
readonly
Returns the value of attribute outer_width.
Instance Method Summary collapse
-
#initialize(settings, content) ⇒ ContentDimensions
constructor
A new instance of ContentDimensions.
Constructor Details
#initialize(settings, content) ⇒ ContentDimensions
Returns a new instance of ContentDimensions.
6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/whirled_peas/graphics/content_dimensions.rb', line 6 def initialize(settings, content) if settings.width @outer_width = settings.width else @outer_width = 0 content.each do |line| @outer_width = line.length if line.length > @outer_width end end @outer_height = settings.height || content.length end |
Instance Attribute Details
#outer_height ⇒ Object (readonly)
Returns the value of attribute outer_height.
4 5 6 |
# File 'lib/whirled_peas/graphics/content_dimensions.rb', line 4 def outer_height @outer_height end |
#outer_width ⇒ Object (readonly)
Returns the value of attribute outer_width.
4 5 6 |
# File 'lib/whirled_peas/graphics/content_dimensions.rb', line 4 def outer_width @outer_width end |