Class: CodeMiner::ForExpression

Inherits:
Expression show all
Defined in:
lib/codeminer/expressions/for_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(params, receiver, body, src) ⇒ ForExpression

Returns a new instance of ForExpression.



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

def initialize(params, receiver, body, src)
  @params = params
  @receiver = receiver
  @body = body
  @src = src
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



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

def body
  @body
end

#paramsObject (readonly)

Returns the value of attribute params.



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

def params
  @params
end

#receiverObject (readonly)

Returns the value of attribute receiver.



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

def receiver
  @receiver
end

#valueObject (readonly)

Returns the value of attribute value.



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

def value
  @value
end

Instance Method Details

#eachObject



14
15
16
# File 'lib/codeminer/expressions/for_expression.rb', line 14

def each
  [@params, @receiver, @body]
end

#typeObject



18
19
20
# File 'lib/codeminer/expressions/for_expression.rb', line 18

def type
  :for
end