Class: Patm::Pattern::Opt
Instance Method Summary
collapse
#&, #[], build_from, #compile, #opt, #rest?
Constructor Details
#initialize(pat) ⇒ Opt
Returns a new instance of Opt.
180
181
182
|
# File 'lib/patm.rb', line 180
def initialize(pat)
@pat = pat
end
|
Instance Method Details
#compile_internal(free_index, target_name = "_obj") ⇒ Object
190
191
192
|
# File 'lib/patm.rb', line 190
def compile_internal(free_index, target_name = "_obj")
@pat.compile_internal(free_index, target_name)
end
|
#execute(match, obj) ⇒ Object
186
187
188
|
# File 'lib/patm.rb', line 186
def execute(match, obj)
@pat.execute(match, obj)
end
|
#inspect ⇒ Object
189
|
# File 'lib/patm.rb', line 189
def inspect; "?#{@pat.inspect}"; end
|
#opt? ⇒ Boolean
183
184
185
|
# File 'lib/patm.rb', line 183
def opt?
true
end
|