Class: CodeMiner::PositionalParamExpression

Inherits:
Expression
  • Object
show all
Defined in:
lib/codeminer/expressions/positional_param_expression.rb

Instance Attribute Summary

Attributes inherited from Expression

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

Class Method Summary collapse

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(token, src) ⇒ PositionalParamExpression

Returns a new instance of PositionalParamExpression.



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

def initialize(token, src)
  @token = token
  @src = src
end

Class Method Details

.convert(exp, src) ⇒ Object



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

def self.convert(exp, src)
  if exp.kind_of?(Token)
    new(exp, src)
  else
    exp
  end
end

Instance Method Details

#eachObject



26
27
28
# File 'lib/codeminer/expressions/positional_param_expression.rb', line 26

def each
  []
end

#typeObject



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

def type
  :positional_param
end

#valueObject



22
23
24
# File 'lib/codeminer/expressions/positional_param_expression.rb', line 22

def value
  @token.value
end