Class: Patm::Pattern::Opt
Instance Method Summary
collapse
#&, #[], build_from, build_from_array, build_from_hash, #compile, #opt, #rest?
Constructor Details
#initialize(pat) ⇒ Opt
Returns a new instance of Opt.
188
189
190
|
# File 'lib/patm.rb', line 188
def initialize(pat)
@pat = pat
end
|
Instance Method Details
#compile_internal(free_index, target_name = "_obj") ⇒ Object
198
199
200
|
# File 'lib/patm.rb', line 198
def compile_internal(free_index, target_name = "_obj")
@pat.compile_internal(free_index, target_name)
end
|
#execute(match, obj) ⇒ Object
194
195
196
|
# File 'lib/patm.rb', line 194
def execute(match, obj)
@pat.execute(match, obj)
end
|
#inspect ⇒ Object
197
|
# File 'lib/patm.rb', line 197
def inspect; "?#{@pat.inspect}"; end
|
#opt? ⇒ Boolean
191
192
193
|
# File 'lib/patm.rb', line 191
def opt?
true
end
|