Class: Patm::Pattern::Opt
Instance Method Summary
collapse
#&, #[], build_from, #compile, #opt, #rest?
Constructor Details
#initialize(pat) ⇒ Opt
Returns a new instance of Opt.
171
172
173
|
# File 'lib/patm.rb', line 171
def initialize(pat)
@pat = pat
end
|
Instance Method Details
#compile_internal(free_index, target_name = "_obj") ⇒ Object
181
182
183
|
# File 'lib/patm.rb', line 181
def compile_internal(free_index, target_name = "_obj")
@pat.compile_internal(free_index, target_name)
end
|
#execute(match, obj) ⇒ Object
177
178
179
|
# File 'lib/patm.rb', line 177
def execute(match, obj)
@pat.execute(match, obj)
end
|
#inspect ⇒ Object
180
|
# File 'lib/patm.rb', line 180
def inspect; "?#{@pat.inspect}"; end
|
#opt? ⇒ Boolean
174
175
176
|
# File 'lib/patm.rb', line 174
def opt?
true
end
|