Class: CodeMiner::ParamsExpression
Instance Attribute Summary collapse
Attributes inherited from Expression
#args, #block, #delimiter, #src, #token
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Expression
not_implemented
#adjust_src, #column=, #end_column=, #end_line=, #line=, #src, #src_extract
Constructor Details
#initialize(positional, optional, keyword, splat, block) ⇒ ParamsExpression
11
12
13
14
15
16
17
|
# File 'lib/codeminer/expressions/params_expression.rb', line 11
def initialize(positional, optional, keyword, splat, block)
@positional = positional
@optional = optional
@keyword = keyword
@splat = splat
@block = block
end
|
Instance Attribute Details
#keyword ⇒ Object
Returns the value of attribute keyword.
9
10
11
|
# File 'lib/codeminer/expressions/params_expression.rb', line 9
def keyword
@keyword
end
|
#optional ⇒ Object
Returns the value of attribute optional.
9
10
11
|
# File 'lib/codeminer/expressions/params_expression.rb', line 9
def optional
@optional
end
|
#positional ⇒ Object
Returns the value of attribute positional.
9
10
11
|
# File 'lib/codeminer/expressions/params_expression.rb', line 9
def positional
@positional
end
|
#splat ⇒ Object
Returns the value of attribute splat.
9
10
11
|
# File 'lib/codeminer/expressions/params_expression.rb', line 9
def splat
@splat
end
|
#value ⇒ Object
Returns the value of attribute value.
9
10
11
|
# File 'lib/codeminer/expressions/params_expression.rb', line 9
def value
@value
end
|
Class Method Details
.empty ⇒ Object
5
6
7
|
# File 'lib/codeminer/expressions/params_expression.rb', line 5
def self.empty
new([], [], [], nil, nil)
end
|
Instance Method Details
#column ⇒ Object
35
36
37
|
# File 'lib/codeminer/expressions/params_expression.rb', line 35
def column
expression_values.map(&:column).first
end
|
#each ⇒ Object
23
24
25
|
# File 'lib/codeminer/expressions/params_expression.rb', line 23
def each
[positional, optional, keyword, *splat, *block]
end
|
#each_param ⇒ Object
27
28
29
|
# File 'lib/codeminer/expressions/params_expression.rb', line 27
def each_param
each.flat_map(&:each)
end
|
#end_column ⇒ Object
43
44
45
|
# File 'lib/codeminer/expressions/params_expression.rb', line 43
def end_column
expression_values.map(&:end_column).last
end
|
#end_line ⇒ Object
39
40
41
|
# File 'lib/codeminer/expressions/params_expression.rb', line 39
def end_line
expression_values.map(&:end_line).last
end
|
#line ⇒ Object
31
32
33
|
# File 'lib/codeminer/expressions/params_expression.rb', line 31
def line
expression_values.map(&:line).first
end
|
#type ⇒ Object
19
20
21
|
# File 'lib/codeminer/expressions/params_expression.rb', line 19
def type
:params
end
|