Class: JIT::Function::If
- Inherits:
-
Object
- Object
- JIT::Function::If
- Defined in:
- lib/jit/function.rb
Overview
:nodoc:
Instance Method Summary collapse
- #else(&block) ⇒ Object
- #elsif(cond, &block) ⇒ Object
- #elsunless(cond, &block) ⇒ Object
- #end ⇒ Object
-
#initialize(function, end_label) ⇒ If
constructor
A new instance of If.
Constructor Details
#initialize(function, end_label) ⇒ If
Returns a new instance of If.
52 53 54 55 |
# File 'lib/jit/function.rb', line 52 def initialize(function, end_label) @function = function @end_label = end_label end |
Instance Method Details
#else(&block) ⇒ Object
57 58 59 60 |
# File 'lib/jit/function.rb', line 57 def else(&block) block.call return self end |
#elsif(cond, &block) ⇒ Object
62 63 64 |
# File 'lib/jit/function.rb', line 62 def elsif(cond, &block) return @function.if(cond, @end_label, &block) end |
#elsunless(cond, &block) ⇒ Object
66 67 68 |
# File 'lib/jit/function.rb', line 66 def elsunless(cond, &block) return @function.unless(cond, @end_label, &block) end |
#end ⇒ Object
70 71 72 |
# File 'lib/jit/function.rb', line 70 def end @function.insn_label(@end_label) end |