Class: ManaMana::RDSL::RequirementNode
Instance Attribute Summary
#offset
Attributes inherited from Node
#children, #name
Instance Method Summary
collapse
#==, #initialize
Methods inherited from Node
#==, #initialize
Instance Method Details
#examples ⇒ Object
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
|
# File 'lib/manamana/rdsl/nodes.rb', line 52
def examples
return [] if children.length == 0
nodes = children[0].rows
= nodes[0].cells
rows = []
nodes[1..-1].each do |node|
row = {}
node.cells.each_with_index do |value, index|
row["<#{[index]}>"] = value
end
rows << row
end
rows
end
|
#expand ⇒ Object
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
|
# File 'lib/manamana/rdsl/nodes.rb', line 80
def expand
return [name] if examples.length == 0
requirements = []
examples.each do |row|
tmp = name.dup
row.each_key do |key|
tmp.gsub! key, row[key]
end
requirements << tmp
end
requirements
end
|