Class: Patm::Pattern::Obj
Instance Method Summary
collapse
#&, #[], build_from, #compile, #opt, #opt?, #rest?
Constructor Details
#initialize(obj) ⇒ Obj
Returns a new instance of Obj.
277
278
279
|
# File 'lib/patm.rb', line 277
def initialize(obj)
@obj = obj
end
|
Instance Method Details
#compile_internal(free_index, target_name = "_obj") ⇒ Object
289
290
291
292
293
294
295
296
|
# File 'lib/patm.rb', line 289
def compile_internal(free_index, target_name = "_obj")
val_src, c, i = Util.compile_value(@obj, free_index)
[
"#{val_src} === #{target_name}",
c,
i
]
end
|
#execute(mmatch, obj) ⇒ Object
281
282
283
|
# File 'lib/patm.rb', line 281
def execute(mmatch, obj)
@obj === obj
end
|
#inspect ⇒ Object
285
286
287
|
# File 'lib/patm.rb', line 285
def inspect
"OBJ(#{@obj.inspect})"
end
|