Sha256: 584b2232c690ebee90949c0c765352633e5e5187a19c93a7c57154e72dc833af

Contents?: true

Size: 895 Bytes

Versions: 34

Compression:

Stored size: 895 Bytes

Contents

module ProductsFilter
  def price(integer)
    sprintf("$%.2d USD", integer / 100.0)
  end
  
  def prettyprint(text)
    text.gsub( /\*(.*)\*/, '<b>\1</b>' )
  end
  
  def count(array)
    array.size
  end
  
  def paragraph(p)
    "<p>#{p}</p>"
  end
end

class Servlet < LiquidServlet
  
  def index
    { 'date' => Time.now }
  end
  
  def products    
    { 'products' => products_list, 'section' => 'Snowboards', 'cool_products' => true}    
  end
  
  private
  
  def products_list
    [{'name' => 'Arbor Draft', 'price' => 39900, 'description' => 'the *arbor draft* is a excellent product' },
    {'name' => 'Arbor Element', 'price' => 40000, 'description' => 'the *arbor element* rocks for freestyling'},
    {'name' => 'Arbor Diamond', 'price' => 59900, 'description' => 'the *arbor diamond* is a made up product because im obsessed with arbor and have no creativity'}]
  end
  
end

Version data entries

34 entries across 34 versions & 4 rubygems

Version Path
liquor-0.1.1 example/server/example_servlet.rb
liquor-0.1.0 example/server/example_servlet.rb
liquid_cms-0.3.2.0 lib/generators/liquid_cms/templates/vendor/plugins/liquid/example/server/example_servlet.rb
liquid_cms-0.2.2.0 generators/liquid_cms/templates/vendor/plugins/cms_plugins/liquid/example/server/example_servlet.rb
liquid_cms-0.2.1.1 generators/liquid_cms/templates/vendor/plugins/cms_plugins/liquid/example/server/example_servlet.rb
liquid_cms-0.3.1.0 lib/generators/liquid_cms/templates/vendor/plugins/liquid/example/server/example_servlet.rb
liquid_cms-0.2.1.0 generators/liquid_cms/templates/vendor/plugins/cms_plugins/liquid/example/server/example_servlet.rb
liquid_cms-0.2.0.13 generators/liquid_cms/templates/vendor/plugins/cms_plugins/liquid/example/server/example_servlet.rb
liquid_cms-0.3.0.10 lib/generators/liquid_cms/templates/vendor/plugins/liquid/example/server/example_servlet.rb
liquid_cms-0.3.0.9 lib/generators/liquid_cms/templates/vendor/plugins/liquid/example/server/example_servlet.rb
liquid_cms-0.2.0.12 generators/liquid_cms/templates/vendor/plugins/cms_plugins/liquid/example/server/example_servlet.rb
liquid_cms-0.2.0.11 generators/liquid_cms/templates/vendor/plugins/cms_plugins/liquid/example/server/example_servlet.rb
liquid_cms-0.2.0.10 generators/liquid_cms/templates/vendor/plugins/cms_plugins/liquid/example/server/example_servlet.rb
liquid_cms-0.3.0.8 lib/generators/liquid_cms/templates/vendor/plugins/liquid/example/server/example_servlet.rb
liquid_cms-0.2.0.9 generators/liquid_cms/templates/vendor/plugins/cms_plugins/liquid/example/server/example_servlet.rb
liquid_cms-0.3.0.7 lib/generators/liquid_cms/templates/vendor/plugins/liquid/example/server/example_servlet.rb
liquid_cms-0.3.0.6 lib/generators/liquid_cms/templates/vendor/plugins/liquid/example/server/example_servlet.rb
liquid_cms-0.2.0.8 generators/liquid_cms/templates/vendor/plugins/cms_plugins/liquid/example/server/example_servlet.rb
liquid_cms-0.3.0.5 lib/generators/liquid_cms/templates/vendor/plugins/liquid/example/server/example_servlet.rb
liquid_cms-0.2.0.7 generators/liquid_cms/templates/vendor/plugins/cms_plugins/liquid/example/server/example_servlet.rb