Class: Tkn2::ContentBlock
- Inherits:
-
Object
- Object
- Tkn2::ContentBlock
- Defined in:
- lib/tkn2/content_block.rb
Instance Attribute Summary collapse
-
#content ⇒ Object
readonly
Returns the value of attribute content.
Instance Method Summary collapse
- #height ⇒ Object
-
#initialize(content) ⇒ ContentBlock
constructor
A new instance of ContentBlock.
- #width ⇒ Object
Constructor Details
#initialize(content) ⇒ ContentBlock
Returns a new instance of ContentBlock.
5 6 7 |
# File 'lib/tkn2/content_block.rb', line 5 def initialize(content) @content = content end |
Instance Attribute Details
#content ⇒ Object (readonly)
Returns the value of attribute content.
3 4 5 |
# File 'lib/tkn2/content_block.rb', line 3 def content @content end |
Instance Method Details
#height ⇒ Object
9 10 11 |
# File 'lib/tkn2/content_block.rb', line 9 def height content.lines.size end |
#width ⇒ Object
13 14 15 |
# File 'lib/tkn2/content_block.rb', line 13 def width content.lines.map(&:size).max end |