Class: AdLint::Cc1::BreakEvent
- Inherits:
-
Object
- Object
- AdLint::Cc1::BreakEvent
- Defined in:
- lib/adlint/cc1/branch.rb
Class Method Summary collapse
Instance Method Summary collapse
- #break? ⇒ Boolean
- #continue? ⇒ Boolean
-
#initialize(type) ⇒ BreakEvent
constructor
A new instance of BreakEvent.
- #return? ⇒ Boolean
- #throw ⇒ Object
Constructor Details
#initialize(type) ⇒ BreakEvent
Returns a new instance of BreakEvent.
286 287 288 |
# File 'lib/adlint/cc1/branch.rb', line 286 def initialize(type) @type = type end |
Class Method Details
.catch(&block) ⇒ Object
266 267 268 |
# File 'lib/adlint/cc1/branch.rb', line 266 def catch(&block) Kernel.catch(:break) { yield; nil } end |
.of_break ⇒ Object
270 271 272 |
# File 'lib/adlint/cc1/branch.rb', line 270 def of_break new(:break) end |
.of_continue ⇒ Object
275 276 277 |
# File 'lib/adlint/cc1/branch.rb', line 275 def of_continue new(:continue) end |
.of_return ⇒ Object
280 281 282 |
# File 'lib/adlint/cc1/branch.rb', line 280 def of_return new(:return) end |
Instance Method Details
#break? ⇒ Boolean
291 292 293 |
# File 'lib/adlint/cc1/branch.rb', line 291 def break? @type == :break end |
#continue? ⇒ Boolean
295 296 297 |
# File 'lib/adlint/cc1/branch.rb', line 295 def continue? @type == :continue end |
#return? ⇒ Boolean
299 300 301 |
# File 'lib/adlint/cc1/branch.rb', line 299 def return? @type == :return end |