Class: Pitchcar::TrackImage

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#trackObject

Returns the value of attribute track.



5
6
7
# File 'lib/track_image.rb', line 5

def track
  @track
end

Instance Method Details

#renderObject



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