Class: Rubinius::AST::DynamicString

Inherits:
StringLiteral show all
Defined in:
lib/compiler/ast/literals.rb

Direct Known Subclasses

DynamicExecuteString, DynamicRegex, DynamicSymbol

Instance Attribute Summary collapse

Attributes inherited from StringLiteral

#string

Attributes inherited from Node

#line

Instance Method Summary collapse

Methods inherited from Node

#ascii_graph, #attributes, #children, match_arguments?, match_send?, #new_block_generator, #new_generator, #node_name, node_name, #pos, #set_child, transform, #transform, transform_comment, transform_kind, transform_kind=, transform_name, #visit, #walk

Constructor Details

#initialize(line, str, array) ⇒ DynamicString

Returns a new instance of DynamicString.



157
158
159
160
161
# File 'lib/compiler/ast/literals.rb', line 157

def initialize(line, str, array)
  @line = line
  @string = str
  @array = array
end

Instance Attribute Details

#arrayObject

Returns the value of attribute array.



155
156
157
# File 'lib/compiler/ast/literals.rb', line 155

def array
  @array
end

#optionsObject

Returns the value of attribute options.



155
156
157
# File 'lib/compiler/ast/literals.rb', line 155

def options
  @options
end

Instance Method Details

#sexp_nameObject



163
164
165
# File 'lib/compiler/ast/literals.rb', line 163

def sexp_name
  :dstr
end

#to_sexpObject



167
168
169
# File 'lib/compiler/ast/literals.rb', line 167

def to_sexp
  @array.inject([sexp_name, @string]) { |s, x| s << x.to_sexp }
end