Class: AtCoderFriends::Generator::InputFormatFragment
Overview
base class for variable declaration generator
Instance Attribute Summary
Attributes inherited from FragmentBase
#templates
Instance Method Summary
collapse
#initialize, #method_missing, #render, #respond_to_missing?, #to_s
Instance Method Details
#components ⇒ Object
99
100
101
102
103
|
# File 'lib/at_coder_friends/generator/fragment.rb', line 99
def components
@components ||= super&.map do |cmp|
self.class.new(cmp, templates)
end
end
|
#delims ⇒ Object
83
84
85
|
# File 'lib/at_coder_friends/generator/fragment.rb', line 83
def delims
delim.chars
end
|
#generate ⇒ Object
62
63
64
|
# File 'lib/at_coder_friends/generator/fragment.rb', line 62
def generate
render(:main)
end
|
#sz1 ⇒ Object
Also known as:
sz
74
75
76
|
# File 'lib/at_coder_friends/generator/fragment.rb', line 74
def sz1
size[0]
end
|
#sz2 ⇒ Object
79
80
81
|
# File 'lib/at_coder_friends/generator/fragment.rb', line 79
def sz2
size[1]
end
|
#v ⇒ Object
70
71
72
|
# File 'lib/at_coder_friends/generator/fragment.rb', line 70
def v
vs[0]
end
|
#vars ⇒ Object
87
88
89
90
91
92
93
94
95
96
97
|
# File 'lib/at_coder_friends/generator/fragment.rb', line 87
def vars
@vars ||= super.map do |v, item|
var = Problem::InputFormat.new(
container: container,
names: [v],
item: item,
size: size
)
self.class.new(var, templates)
end
end
|
#vs ⇒ Object
66
67
68
|
# File 'lib/at_coder_friends/generator/fragment.rb', line 66
def vs
names
end
|