 
 	getHeight: ->
 		ratio = @getRatio()
-		400
+		HEIGHT * ratio
+
+	getSlug: ->
+		@$context.data DATA_SLUG
 
 	getRatio: ->
-		1+		ratio = @$context.data DATA_RATIO
+		return if ratio then parseInt(ratio, 10) else 1
		watcher.destroy() if watcher isnt null

	injectCodePenMarkup: =>
		slug = @$context.data DATA_SLUG

		if slug?
			height = @getHeight()
			tmpl = @getTemplate height: height, slug: slug

			@$context.append tmpl

			setTimeout =>
				@initCodePenJS()

	ASSET_EI_JS_URL = '//assets.codepen.io/assets/embed/ei.js'
	DATA_SLUG = 'slug'
	DATA_OFFSET = 'offset'
	DATA_RATIO = 'ratio'
	HEIGHT = 400
	watcher = null

	constructor: (@$context) ->
