123456789_123456789_123456789_123456789_123456789_

Class: RBS::Test::ArgumentsReturn

Relationships & Source Files
Inherits: Object
Defined in: lib/rbs/test.rb

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Constructor Details

.new(arguments:, exit_value:, exit_type:) ⇒ ArgumentsReturn

[ GitHub ]

  
# 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

Class Method Details

.break(arguments:)

[ GitHub ]

  
# File 'lib/rbs/test.rb', line 44

def self.break(arguments:)
  new(arguments: arguments, exit_value: nil, exit_type: :break)
end

.exception(arguments:, exception:)

[ GitHub ]

  
# 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:)

[ GitHub ]

  
# File 'lib/rbs/test.rb', line 36

def self.return(arguments:, value:)
  new(arguments: arguments, exit_value: value, exit_type: :return)
end

Instance Attribute Details

#arguments (readonly)

[ GitHub ]

  
# File 'lib/rbs/test.rb', line 26

attr_reader :arguments

#break?Boolean (readonly)

[ GitHub ]

  
# File 'lib/rbs/test.rb', line 66

def break?
  exit_type == :break
end

#exception?Boolean (readonly)

[ GitHub ]

  
# File 'lib/rbs/test.rb', line 62

def exception?
  exit_type == :exception
end

#exit_type (readonly)

[ GitHub ]

  
# File 'lib/rbs/test.rb', line 28

attr_reader :exit_type

#exit_value (readonly)

[ GitHub ]

  
# File 'lib/rbs/test.rb', line 27

attr_reader :exit_value

#return?Boolean (readonly)

[ GitHub ]

  
# File 'lib/rbs/test.rb', line 58

def return?
  exit_type == :return
end

Instance Method Details

#exception (readonly)

[ GitHub ]

  
# File 'lib/rbs/test.rb', line 53

def exception
  raise unless exit_type == :exception
  exit_value
end

#return_value

[ GitHub ]

  
# File 'lib/rbs/test.rb', line 48

def return_value
  raise unless exit_type == :return
  exit_value
end