Class: CodeMiner::CommandExpression
- Inherits:
-
Expression
- Object
- Expression
- CodeMiner::CommandExpression
- Defined in:
- lib/codeminer/expressions/command_expression.rb
Instance Attribute Summary collapse
-
#args ⇒ Object
(also: #body)
readonly
Returns the value of attribute args.
-
#receiver ⇒ Object
readonly
Returns the value of attribute receiver.
Attributes inherited from Expression
#block, #delimiter, #src, #token
Instance Method Summary collapse
- #each ⇒ Object
-
#initialize(token, args, src, receiver = nil) ⇒ CommandExpression
constructor
A new instance of CommandExpression.
- #type ⇒ Object
- #value ⇒ 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(token, args, src, receiver = nil) ⇒ CommandExpression
Returns a new instance of CommandExpression.
7 8 9 10 11 12 |
# File 'lib/codeminer/expressions/command_expression.rb', line 7 def initialize(token, args, src, receiver=nil) @token = token @args = args @src = src @receiver = receiver end |
Instance Attribute Details
#args ⇒ Object (readonly) Also known as: body
Returns the value of attribute args.
5 6 7 |
# File 'lib/codeminer/expressions/command_expression.rb', line 5 def args @args end |
#receiver ⇒ Object (readonly)
Returns the value of attribute receiver.
5 6 7 |
# File 'lib/codeminer/expressions/command_expression.rb', line 5 def receiver @receiver end |
Instance Method Details
#each ⇒ Object
22 23 24 |
# File 'lib/codeminer/expressions/command_expression.rb', line 22 def each [@receiver, @args].compact end |
#type ⇒ Object
18 19 20 |
# File 'lib/codeminer/expressions/command_expression.rb', line 18 def type :command end |
#value ⇒ Object
14 15 16 |
# File 'lib/codeminer/expressions/command_expression.rb', line 14 def value @token.value end |