Class: CodeMiner::DynamicStringExpression
- Inherits:
-
Expression
- Object
- Expression
- CodeMiner::DynamicStringExpression
show all
- Defined in:
- lib/codeminer/expressions/dynamic_string_expression.rb
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, #column=, #end_column, #end_column=, #end_line, #end_line=, #line, #line=, #src, #src_extract
Constructor Details
15
16
17
18
|
# File 'lib/codeminer/expressions/dynamic_string_expression.rb', line 15
def initialize(*body, src)
@src = src
@body = body
end
|
Instance Attribute Details
#value ⇒ Object
Returns the value of attribute value.
13
14
15
|
# File 'lib/codeminer/expressions/dynamic_string_expression.rb', line 13
def value
@value
end
|
Class Method Details
.wrap(exp) ⇒ Object
5
6
7
8
9
10
11
|
# File 'lib/codeminer/expressions/dynamic_string_expression.rb', line 5
def self.wrap(exp)
if exp.type == :dynamic_string
exp
else
new(exp, exp.)
end
end
|
Instance Method Details
#add(string, src = string.src_extract) ⇒ Object
28
29
30
31
32
|
# File 'lib/codeminer/expressions/dynamic_string_expression.rb', line 28
def add(string, src=string.)
@body << string
adjust_src(src)
self
end
|
#each ⇒ Object
24
25
26
|
# File 'lib/codeminer/expressions/dynamic_string_expression.rb', line 24
def each
@body
end
|
#type ⇒ Object
20
21
22
|
# File 'lib/codeminer/expressions/dynamic_string_expression.rb', line 20
def type
:dynamic_string
end
|