Class: SequenceLogo::GluingCanvas
- Defined in:
- lib/sequence_logo/canvases/gluing_canvas.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#i_logo ⇒ Object
readonly
Returns the value of attribute i_logo.
-
#size ⇒ Object
readonly
Returns the value of attribute size.
Instance Method Summary collapse
- #add_image(item) ⇒ Object
- #background(fill) ⇒ Object
- #image ⇒ Object
-
#initialize ⇒ GluingCanvas
constructor
A new instance of GluingCanvas.
Constructor Details
#initialize ⇒ GluingCanvas
Returns a new instance of GluingCanvas.
6 7 8 9 10 11 |
# File 'lib/sequence_logo/canvases/gluing_canvas.rb', line 6 def initialize @i_logo = Magick::ImageList.new @size = 0 @rendering_callbacks = [] @rendering_callbacks << method(:render_background) end |
Instance Attribute Details
#i_logo ⇒ Object (readonly)
Returns the value of attribute i_logo.
5 6 7 |
# File 'lib/sequence_logo/canvases/gluing_canvas.rb', line 5 def i_logo @i_logo end |
#size ⇒ Object (readonly)
Returns the value of attribute size.
5 6 7 |
# File 'lib/sequence_logo/canvases/gluing_canvas.rb', line 5 def size @size end |
Instance Method Details
#add_image(item) ⇒ Object
31 32 33 |
# File 'lib/sequence_logo/canvases/gluing_canvas.rb', line 31 def add_image(item) @size += 1 end |
#background(fill) ⇒ Object
18 19 20 |
# File 'lib/sequence_logo/canvases/gluing_canvas.rb', line 18 def background(fill) @background_fill = fill end |
#image ⇒ Object
13 14 15 16 |
# File 'lib/sequence_logo/canvases/gluing_canvas.rb', line 13 def image @rendering_callbacks.each(&:call) @i_logo.flatten_images end |