Debian Codegraph @

test/fixtures/nested_objects.rb

raw symbols SCIP
1 require 'mustache'
2 require 'ostruct'
3
4 class NestedObjects < Mustache
5 self.path = File.dirname(__FILE__)
6
7 def header
8 "Colors"
9 end
10
11 def item
12 items = []
13 items << OpenStruct.new(:name => 'red', :current => true, :url => '#Red')
14 items << OpenStruct.new(:name => 'green', :current => false, :url => '#Green')
15 items << OpenStruct.new(:name => 'blue', :current => false, :url => '#Blue')
16 items
17 end
18
19 def link
20 not self[:current]
21 end
22
23 def list
24 not item.empty?
25 end
26
27 def empty
28 item.empty?
29 end
30 end
31
32 if $0 == __FILE__
33 puts NestedObjects.to_html
34 end