Class: Estreet::ThrowStatement
- Defined in:
- lib/estreet/exceptions.rb
Instance Attribute Summary
Attributes inherited from Node
Class Method Summary collapse
Instance Method Summary collapse
- #attributes ⇒ Object
-
#initialize(argument) ⇒ ThrowStatement
constructor
A new instance of ThrowStatement.
Methods inherited from Statement
Methods inherited from Node
Constructor Details
#initialize(argument) ⇒ ThrowStatement
Returns a new instance of ThrowStatement.
3 4 5 |
# File 'lib/estreet/exceptions.rb', line 3 def initialize(argument) @argument = argument.to_expression end |
Class Method Details
.error(expression) ⇒ Object
11 12 13 |
# File 'lib/estreet/exceptions.rb', line 11 def self.error(expression) new(NewExpression.new(Identifier['Error'], [expression.to_expression])) end |
Instance Method Details
#attributes ⇒ Object
7 8 9 |
# File 'lib/estreet/exceptions.rb', line 7 def attributes super.merge(argument: @argument) end |