forked from vim-ruby/vim-ruby
/
nested_hashes.rb
53 lines (48 loc) · 969 Bytes
/
nested_hashes.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
class Foo
# nested do ... end blocks:
var.func1(:param => 'value') do
var.func2(:param => 'value') do
puts "test"
end
end
# nested { ... } blocks
var.func1(:param => 'value') {
var.func2(:param => 'value') {
foo({ bar => baz })
puts "test one"
puts "test two"
}
}
# nested hash
foo, bar = {
:bar => {
:one => 'two',
:five => 'six'
}
}
# nested { ... } blocks with a continued first line
var.
func1(:param => 'value') {
var.func2(:param => 'value') {
puts "test"
}
}
# nested hashes with a continued first line
foo,
bar = {
:bar => {
:foo => { 'bar' => 'baz' },
:one => 'two',
:three => 'four'
}
}
# TODO nested { ... } blocks with a continued first line and a function call
# inbetween
var.
func1(:param => 'value') {
func1_5(:param => 'value')
var.func2(:param => 'value') {
puts "test"
}
}
end