Class: CodeMiner::UnaryExpression

Inherits:
Expression show all
Defined in:
lib/codeminer/expressions/unary_expression.rb

Instance Attribute Summary collapse

Attributes inherited from Expression

#args, #block, #delimiter, #src, #token

Instance Method Summary collapse

Methods inherited from Expression

not_implemented

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(value, receiver, src) ⇒ UnaryExpression

Returns a new instance of UnaryExpression.



7
8
9
10
11
# File 'lib/codeminer/expressions/unary_expression.rb', line 7

def initialize(value, receiver, src)
  @value = value
  @receiver = receiver
  @src = src
end

Instance Attribute Details

#receiverObject (readonly)

Returns the value of attribute receiver.



5
6
7
# File 'lib/codeminer/expressions/unary_expression.rb', line 5

def receiver
  @receiver
end

#valueObject (readonly)

Returns the value of attribute value.



5
6
7
# File 'lib/codeminer/expressions/unary_expression.rb', line 5

def value
  @value
end

Instance Method Details

#eachObject



17
18
19
# File 'lib/codeminer/expressions/unary_expression.rb', line 17

def each
  [@receiver]
end

#typeObject



13
14
15
# File 'lib/codeminer/expressions/unary_expression.rb', line 13

def type
  :unary
end