Class: Effective::Templates::Template

Inherits:
Object
  • Object
show all
Defined in:
app/models/effective/templates/template.rb

Direct Known Subclasses

ImageAndTitle

Instance Method Summary collapse

Instance Method Details

#class_nameObject



20
21
22
# File 'app/models/effective/templates/template.rb', line 20

def class_name
  @class_name ||= self.class.name.demodulize.underscore.to_sym
end

#descriptionObject



8
9
10
# File 'app/models/effective/templates/template.rb', line 8

def description
  "Insert #{title}"
end

#imageObject



12
13
14
# File 'app/models/effective/templates/template.rb', line 12

def image
  "#{class_name}.png"
end

#titleObject



4
5
6
# File 'app/models/effective/templates/template.rb', line 4

def title
  class_name.to_s.humanize
end

#to_partial_pathObject



16
17
18
# File 'app/models/effective/templates/template.rb', line 16

def to_partial_path
  "effective/templates/#{class_name}"
end