Class: Material

Inherits:
ActiveRecord::Base
  • Object
show all
Extended by:
ApiHandling
Defined in:
app/models/material.rb

Instance Method Summary collapse

Methods included from ApiHandling

expose_api

Instance Method Details

#generate_previewObject


14
15
16
17
18
19
20
# File 'app/models/material.rb', line 14

def generate_preview
  generator = PreviewGenerator.new(self.url)
  generator.generate_preview
  self.preview_type = generator.type
  self.preview_code = generator.code
  save
end