Class: CodeMiner::StringExpression
Instance Attribute Summary collapse
Attributes inherited from Expression
#args, #block, #delimiter, #src
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Expression
not_implemented
#adjust_src, #column, #column=, #end_column, #end_column=, #end_line, #end_line=, #line, #line=, #src, #src_extract
Constructor Details
Returns a new instance of StringExpression.
17
18
19
20
|
# File 'lib/codeminer/expressions/string_expression.rb', line 17
def initialize(token, src)
@token = token
@src = src
end
|
Instance Attribute Details
#token ⇒ Object
Returns the value of attribute token.
15
16
17
|
# File 'lib/codeminer/expressions/string_expression.rb', line 15
def token
@token
end
|
Class Method Details
.convert(exp) ⇒ Object
7
8
9
10
11
12
13
|
# File 'lib/codeminer/expressions/string_expression.rb', line 7
def self.convert(exp)
if exp.kind_of?(Token)
new(exp, exp.)
else
exp
end
end
|
Instance Method Details
#add(string, src) ⇒ Object
30
31
32
|
# File 'lib/codeminer/expressions/string_expression.rb', line 30
def add(string, src)
DynamicStringExpression.new(*[self, *string], src)
end
|
#add_quotes(src) ⇒ Object
34
35
36
37
|
# File 'lib/codeminer/expressions/string_expression.rb', line 34
def add_quotes(src)
@src = src
self
end
|
#each ⇒ Object
39
40
41
|
# File 'lib/codeminer/expressions/string_expression.rb', line 39
def each
[]
end
|
#type ⇒ Object
22
23
24
|
# File 'lib/codeminer/expressions/string_expression.rb', line 22
def type
:string
end
|
#value ⇒ Object
26
27
28
|
# File 'lib/codeminer/expressions/string_expression.rb', line 26
def value
@token.value
end
|