-
Notifications
You must be signed in to change notification settings - Fork 1
Setting up a basic renderer
Jodi Winters edited this page Jul 27, 2016
·
2 revisions
This gem requires you to have at least one component, which has within it at least one view/template pair.
src
├── components
│ ├── weather
│ │ ├── models
│ │ │ ├── daily_summary.rb
│ │ │ ├── weekly_summary.rb
│ │ ├── templates
│ │ │ ├── daily_summary.mustache
│ │ │ ├── weekly_summary.mustachedaily_summary.rb
require 'alephant/renderer/views/html'
require 'date'
class DailySummary < Alephant::Renderer::Views::Html
def temp
@data[:time].round 0
end
def time
DateTime.now.strftime "%d/%m/%Y %H:%M"
end
def summary
@data[:summary].capitalize
end
enddaily_summary.mustache
Weather for {{ time }}
{{ summary }} - {{ temp }}°