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.
28 29 30 31 32 |
# File 'lib/rbs/test.rb', line 28 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.
24 25 26 |
# File 'lib/rbs/test.rb', line 24 def arguments @arguments end |
#exit_type ⇒ Object (readonly)
Returns the value of attribute exit_type.
26 27 28 |
# File 'lib/rbs/test.rb', line 26 def exit_type @exit_type end |
#exit_value ⇒ Object (readonly)
Returns the value of attribute exit_value.
25 26 27 |
# File 'lib/rbs/test.rb', line 25 def exit_value @exit_value end |
Class Method Details
.break(arguments:) ⇒ Object
42 43 44 |
# File 'lib/rbs/test.rb', line 42 def self.break(arguments:) new(arguments: arguments, exit_value: nil, exit_type: :break) end |
.exception(arguments:, exception:) ⇒ Object
38 39 40 |
# File 'lib/rbs/test.rb', line 38 def self.exception(arguments:, exception:) new(arguments: arguments, exit_value: exception, exit_type: :exception) end |
.return(arguments:, value:) ⇒ Object
34 35 36 |
# File 'lib/rbs/test.rb', line 34 def self.return(arguments:, value:) new(arguments: arguments, exit_value: value, exit_type: :return) end |
Instance Method Details
#break? ⇒ Boolean
64 65 66 |
# File 'lib/rbs/test.rb', line 64 def break? exit_type == :break end |
#exception ⇒ Object
51 52 53 54 |
# File 'lib/rbs/test.rb', line 51 def exception raise unless exit_type == :exception exit_value end |
#exception? ⇒ Boolean
60 61 62 |
# File 'lib/rbs/test.rb', line 60 def exception? exit_type == :exception end |
#return? ⇒ Boolean
56 57 58 |
# File 'lib/rbs/test.rb', line 56 def return? exit_type == :return end |
#return_value ⇒ Object
46 47 48 49 |
# File 'lib/rbs/test.rb', line 46 def return_value raise unless exit_type == :return exit_value end |