Class: RBS::Test::ArgumentsReturn
- Inherits:
-
Object
- Object
- RBS::Test::ArgumentsReturn
- Defined in:
- lib/rbs/test.rb
Instance Attribute Summary collapse
-
#arguments ⇒ Object
readonly
Returns the value of attribute arguments.
-
#exit_type ⇒ Object
readonly
Returns the value of attribute exit_type.
-
#exit_value ⇒ Object
readonly
Returns the value of attribute exit_value.
Class Method Summary collapse
- .break(arguments:) ⇒ Object
- .exception(arguments:, exception:) ⇒ Object
- .return(arguments:, value:) ⇒ Object
Instance Method Summary collapse
- #break? ⇒ Boolean
- #exception ⇒ Object
- #exception? ⇒ Boolean
-
#initialize(arguments:, exit_value:, exit_type:) ⇒ ArgumentsReturn
constructor
A new instance of ArgumentsReturn.
- #return? ⇒ Boolean
- #return_value ⇒ Object
Constructor Details
#initialize(arguments:, exit_value:, exit_type:) ⇒ ArgumentsReturn
Returns a new instance of ArgumentsReturn.
30 31 32 33 34 |
# File 'lib/rbs/test.rb', line 30 def initialize(arguments:, exit_value:, exit_type:) @arguments = arguments @exit_value = exit_value @exit_type = exit_type end |
Instance Attribute Details
#arguments ⇒ Object (readonly)
Returns the value of attribute arguments.
26 27 28 |
# File 'lib/rbs/test.rb', line 26 def arguments @arguments end |
#exit_type ⇒ Object (readonly)
Returns the value of attribute exit_type.
28 29 30 |
# File 'lib/rbs/test.rb', line 28 def exit_type @exit_type end |
#exit_value ⇒ Object (readonly)
Returns the value of attribute exit_value.
27 28 29 |
# File 'lib/rbs/test.rb', line 27 def exit_value @exit_value end |
Class Method Details
.break(arguments:) ⇒ Object
44 45 46 |
# File 'lib/rbs/test.rb', line 44 def self.break(arguments:) new(arguments: arguments, exit_value: nil, exit_type: :break) end |
.exception(arguments:, exception:) ⇒ Object
40 41 42 |
# File 'lib/rbs/test.rb', line 40 def self.exception(arguments:, exception:) new(arguments: arguments, exit_value: exception, exit_type: :exception) end |
.return(arguments:, value:) ⇒ Object
36 37 38 |
# File 'lib/rbs/test.rb', line 36 def self.return(arguments:, value:) new(arguments: arguments, exit_value: value, exit_type: :return) end |
Instance Method Details
#break? ⇒ Boolean
66 67 68 |
# File 'lib/rbs/test.rb', line 66 def break? exit_type == :break end |
#exception ⇒ Object
53 54 55 56 |
# File 'lib/rbs/test.rb', line 53 def exception raise unless exit_type == :exception exit_value end |
#exception? ⇒ Boolean
62 63 64 |
# File 'lib/rbs/test.rb', line 62 def exception? exit_type == :exception end |
#return? ⇒ Boolean
58 59 60 |
# File 'lib/rbs/test.rb', line 58 def return? exit_type == :return end |
#return_value ⇒ Object
48 49 50 51 |
# File 'lib/rbs/test.rb', line 48 def return_value raise unless exit_type == :return exit_value end |