class AdLint::Cc1::BreakEvent

Public Class Methods

catch() { || ... } click to toggle source
# File lib/adlint/cc1/branch.rb, line 266
def catch(&block)
  Kernel.catch(:break) { yield; nil }
end
of_break() click to toggle source
# File lib/adlint/cc1/branch.rb, line 270
def of_break
  new(:break)
end
of_continue() click to toggle source
# File lib/adlint/cc1/branch.rb, line 275
def of_continue
  new(:continue)
end
of_return() click to toggle source
# File lib/adlint/cc1/branch.rb, line 280
def of_return
  new(:return)
end

Private Class Methods

new(type) click to toggle source
# File lib/adlint/cc1/branch.rb, line 286
def initialize(type)
  @type = type
end

Public Instance Methods

break?() click to toggle source
# File lib/adlint/cc1/branch.rb, line 291
def break?
  @type == :break
end
continue?() click to toggle source
# File lib/adlint/cc1/branch.rb, line 295
def continue?
  @type == :continue
end
return?() click to toggle source
# File lib/adlint/cc1/branch.rb, line 299
def return?
  @type == :return
end
throw() click to toggle source
# File lib/adlint/cc1/branch.rb, line 303
def throw
  Kernel.throw(:break, self)
end