Module: TrebuchetHelper

Defined in:
app/helpers/trebuchet_helper.rb

Instance Method Summary collapse

Instance Method Details

#feature(feature) ⇒ Object



3
4
5
6
# File 'app/helpers/trebuchet_helper.rb', line 3

def feature(feature)
  "<dd>#{feature.name}</dd>
  <dt><ul>#{strategy feature.strategy}</ul></dt>"
end

#strategy(strategy) ⇒ Object



8
9
10
11
12
13
14
15
16
# File 'app/helpers/trebuchet_helper.rb', line 8

def strategy(strategy)
  html =  case strategy.name
          when :multiple
            strategy.strategies.map { |s| strategy s }.join().html_safe
          else
            strategy.to_s
          end
  strategy.name == :multiple ? html : (:li, html)
end

#trebuchet_cssObject



18
19
20
21
# File 'app/helpers/trebuchet_helper.rb', line 18

def trebuchet_css
  filename = File.expand_path(File.dirname(__FILE__) + "/../views/trebuchet_rails/trebuchet.css")
  return IO.read(filename)
end