Class: CodeMiner::ConditionExpression
- Inherits:
-
Expression
- Object
- Expression
- CodeMiner::ConditionExpression
- Defined in:
- lib/codeminer/expressions/condition_expression.rb
Instance Attribute Summary collapse
-
#consequence ⇒ Object
readonly
Returns the value of attribute consequence.
-
#else_statement ⇒ Object
readonly
Returns the value of attribute else_statement.
-
#test ⇒ Object
readonly
Returns the value of attribute test.
-
#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(test, consequence, else_statement, token, src) ⇒ ConditionExpression
constructor
A new instance of ConditionExpression.
- #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(test, consequence, else_statement, token, src) ⇒ ConditionExpression
Returns a new instance of ConditionExpression.
7 8 9 10 11 12 13 |
# File 'lib/codeminer/expressions/condition_expression.rb', line 7 def initialize(test, consequence, else_statement, token, src) @test = test @consequence = consequence @else_statement = else_statement @token = token @src = src end |
Instance Attribute Details
#consequence ⇒ Object (readonly)
Returns the value of attribute consequence.
5 6 7 |
# File 'lib/codeminer/expressions/condition_expression.rb', line 5 def consequence @consequence end |
#else_statement ⇒ Object (readonly)
Returns the value of attribute else_statement.
5 6 7 |
# File 'lib/codeminer/expressions/condition_expression.rb', line 5 def else_statement @else_statement end |
#test ⇒ Object (readonly)
Returns the value of attribute test.
5 6 7 |
# File 'lib/codeminer/expressions/condition_expression.rb', line 5 def test @test end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
5 6 7 |
# File 'lib/codeminer/expressions/condition_expression.rb', line 5 def value @value end |
Instance Method Details
#each ⇒ Object
19 20 21 |
# File 'lib/codeminer/expressions/condition_expression.rb', line 19 def each [@test, @consequence, @else_statement] end |
#type ⇒ Object
15 16 17 |
# File 'lib/codeminer/expressions/condition_expression.rb', line 15 def type :condition end |