Class: Tuftify::Panel
- Inherits:
-
Object
- Object
- Tuftify::Panel
- Defined in:
- lib/tuftify/panel.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#canvas ⇒ Object
Returns the value of attribute canvas.
-
#height ⇒ Object
Returns the value of attribute height.
-
#width ⇒ Object
Returns the value of attribute width.
-
#x ⇒ Object
Returns the value of attribute x.
-
#y ⇒ Object
Returns the value of attribute y.
Instance Method Summary collapse
- #draw ⇒ Object
-
#initialize(x, y, width, height, canvas, options = {}) ⇒ Panel
constructor
A new instance of Panel.
Constructor Details
#initialize(x, y, width, height, canvas, options = {}) ⇒ Panel
Returns a new instance of Panel.
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/tuftify/panel.rb', line 10 def initialize(x, y, width, height, canvas, = {}) @x, @y = x, y @width, @height = width, height @canvas = canvas @options = .clone @drawing = Magick::Draw.new @drawing.font_family = @options[:font_family] @drawing.fill = @options[:fill] @drawing.pointsize = @options[:pointsize] @drawing.gravity = @options[:gravity] end |
Instance Attribute Details
#canvas ⇒ Object
Returns the value of attribute canvas.
8 9 10 |
# File 'lib/tuftify/panel.rb', line 8 def canvas @canvas end |
#height ⇒ Object
Returns the value of attribute height.
7 8 9 |
# File 'lib/tuftify/panel.rb', line 7 def height @height end |
#width ⇒ Object
Returns the value of attribute width.
7 8 9 |
# File 'lib/tuftify/panel.rb', line 7 def width @width end |
#x ⇒ Object
Returns the value of attribute x.
6 7 8 |
# File 'lib/tuftify/panel.rb', line 6 def x @x end |
#y ⇒ Object
Returns the value of attribute y.
6 7 8 |
# File 'lib/tuftify/panel.rb', line 6 def y @y end |
Instance Method Details
#draw ⇒ Object
23 24 25 |
# File 'lib/tuftify/panel.rb', line 23 def draw end |