Class: Pitchcar::TrackImage
- Inherits:
-
Object
- Object
- Pitchcar::TrackImage
- Defined in:
- lib/track_image.rb
Constant Summary collapse
- TILE_SIZE =
570
- OFFSET_SIZE =
-50
- TITLE_OFFSET =
200
- BLANK_TILE =
Magick::Image.new(TILE_SIZE, TILE_SIZE) { |canvas| canvas.background_color = 'white' }
Instance Attribute Summary collapse
-
#track ⇒ Object
Returns the value of attribute track.
Instance Method Summary collapse
-
#initialize(track) ⇒ TrackImage
constructor
A new instance of TrackImage.
- #render ⇒ Object
Constructor Details
#initialize(track) ⇒ TrackImage
Returns a new instance of TrackImage.
11 12 13 |
# File 'lib/track_image.rb', line 11 def initialize(track) self.track = track end |
Instance Attribute Details
#track ⇒ Object
Returns the value of attribute track.
5 6 7 |
# File 'lib/track_image.rb', line 5 def track @track end |
Instance Method Details
#render ⇒ Object
15 16 17 18 19 |
# File 'lib/track_image.rb', line 15 def render track_image = render_track(build_tiles) add_title_to(track_image) track_image.write('track.png') end |