Class: CodeMiner::WhenExpression
- Inherits:
-
Expression
- Object
- Expression
- CodeMiner::WhenExpression
- Defined in:
- lib/codeminer/expressions/when_expression.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#else ⇒ Object
readonly
Returns the value of attribute else.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Attributes inherited from Expression
#args, #block, #delimiter, #src, #token
Instance Method Summary collapse
- #each ⇒ Object
-
#initialize(args, body, else_exp, src) ⇒ WhenExpression
constructor
A new instance of WhenExpression.
- #type ⇒ Object
Methods inherited from Expression
Methods included from SourceExtract::Usage
#adjust_src, #column, #column=, #end_column, #end_column=, #end_line, #end_line=, #line, #line=, #src, #src_extract
Constructor Details
#initialize(args, body, else_exp, src) ⇒ WhenExpression
Returns a new instance of WhenExpression.
7 8 9 10 11 12 |
# File 'lib/codeminer/expressions/when_expression.rb', line 7 def initialize(args, body, else_exp, src) @args = args @body = body @else = else_exp @src = src end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
5 6 7 |
# File 'lib/codeminer/expressions/when_expression.rb', line 5 def body @body end |
#else ⇒ Object (readonly)
Returns the value of attribute else.
5 6 7 |
# File 'lib/codeminer/expressions/when_expression.rb', line 5 def else @else end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
5 6 7 |
# File 'lib/codeminer/expressions/when_expression.rb', line 5 def value @value end |
Instance Method Details
#each ⇒ Object
18 19 20 |
# File 'lib/codeminer/expressions/when_expression.rb', line 18 def each [@args, @body] end |
#type ⇒ Object
14 15 16 |
# File 'lib/codeminer/expressions/when_expression.rb', line 14 def type :when end |