Class: CodeMiner::ParamsExpression
- Inherits:
-
Expression
- Object
- Expression
- CodeMiner::ParamsExpression
- Defined in:
- lib/codeminer/expressions/params_expression.rb
Instance Attribute Summary collapse
-
#keyword ⇒ Object
readonly
Returns the value of attribute keyword.
-
#optional ⇒ Object
readonly
Returns the value of attribute optional.
-
#positional ⇒ Object
readonly
Returns the value of attribute positional.
-
#splat ⇒ Object
readonly
Returns the value of attribute splat.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Attributes inherited from Expression
#args, #block, #delimiter, #src, #token
Class Method Summary collapse
Instance Method Summary collapse
- #column ⇒ Object
- #each ⇒ Object
- #each_param ⇒ Object
- #end_column ⇒ Object
- #end_line ⇒ Object
-
#initialize(positional, optional, keyword, splat, block) ⇒ ParamsExpression
constructor
A new instance of ParamsExpression.
- #line ⇒ Object
- #type ⇒ Object
Methods inherited from Expression
Methods included from SourceExtract::Usage
#adjust_src, #column=, #end_column=, #end_line=, #line=, #src, #src_extract
Constructor Details
#initialize(positional, optional, keyword, splat, block) ⇒ ParamsExpression
Returns a new instance of 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 (readonly)
Returns the value of attribute keyword.
9 10 11 |
# File 'lib/codeminer/expressions/params_expression.rb', line 9 def keyword @keyword end |
#optional ⇒ Object (readonly)
Returns the value of attribute optional.
9 10 11 |
# File 'lib/codeminer/expressions/params_expression.rb', line 9 def optional @optional end |
#positional ⇒ Object (readonly)
Returns the value of attribute positional.
9 10 11 |
# File 'lib/codeminer/expressions/params_expression.rb', line 9 def positional @positional end |
#splat ⇒ Object (readonly)
Returns the value of attribute splat.
9 10 11 |
# File 'lib/codeminer/expressions/params_expression.rb', line 9 def splat @splat end |
#value ⇒ Object (readonly)
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 |