Sha256: d5a67b1557cf8dfdb6107e92050f4be9d7a04bfa1797bf14bc230176a865008e

Contents?: true

Size: 590 Bytes

Versions: 26

Compression:

Stored size: 590 Bytes

Contents

$LOAD_PATH.unshift File.dirname(__FILE__) + '/../lib'
require 'mustache'

class ComplexView < Mustache
  self.path = File.dirname(__FILE__)

  def header
    "Colors"
  end

  def item
    items = []
    items << { :name => 'red', :current => true, :url => '#Red' }
    items << { :name => 'green', :current => false, :url => '#Green' }
    items << { :name => 'blue', :current => false, :url => '#Blue' }
    items
  end

  def link
    not self[:current]
  end

  def list
    not item.empty?
  end

  def empty
    item.empty?
  end
end

if $0 == __FILE__
  puts ComplexView.to_html
end

Version data entries

26 entries across 26 versions & 4 rubygems

Version Path
mustache-0.99.8 test/fixtures/complex_view.rb
mustache-0.99.7 test/fixtures/complex_view.rb
mustache-0.99.6 test/fixtures/complex_view.rb
mustache-0.99.5 test/fixtures/complex_view.rb
resque-pool-0.3.0 vendor/bundle/ruby/1.8/gems/mustache-0.99.4/test/fixtures/complex_view.rb
resque-pool-0.3.0.beta.2 vendor/bundle/ruby/1.8/gems/mustache-0.99.4/test/fixtures/complex_view.rb
mustache-bibanon-0.99.5 test/fixtures/complex_view.rb
mustache-0.99.4 test/fixtures/complex_view.rb
mustache-0.99.3 test/fixtures/complex_view.rb
mustache-0.99.2 test/fixtures/complex_view.rb
mustache-0.99.1 test/fixtures/complex_view.rb
mustache-0.99.0 test/fixtures/complex_view.rb
mustache-0.98.0 test/fixtures/complex_view.rb
mustache-0.13.0 test/fixtures/complex_view.rb
mustache-0.12.1 test/fixtures/complex_view.rb
mustache-0.12.0 test/fixtures/complex_view.rb
angry_mob_common_targets-0.1.0 vendor/mustache/test/fixtures/complex_view.rb
mustache-0.11.2 test/fixtures/complex_view.rb
mustache-0.11.1 test/fixtures/complex_view.rb
mustache-0.11.0 test/fixtures/complex_view.rb