Class: Red::LiteralNode::Symbol
- Inherits:
-
Red::LiteralNode
- Object
- String
- Red::LiteralNode
- Red::LiteralNode::Symbol
- Defined in:
- lib/red/nodes/literal_nodes.rb
Overview
:nodoc:
Instance Method Summary collapse
-
#initialize(*element_sexps) ⇒ Symbol
constructor
- :lit, symbol
-
[:dsym, “foo”, expression, expression, …].
Methods inherited from String
#%, #*, #+, #<<, #<=>, #==, #=~, #[], #[]=, #capitalize, #capitalize!, #casecmp, #center, #chomp, #chomp!, #chop, #chop!, #concat, #count, #crypt, #delete, #delete!, #downcase, #downcase!, #each, #each_byte, #each_line, #empty?, #eql?, #gsub, #gsub!, #hash, #hex, #include?, #index, #insert, #inspect, #intern, #length, #ljust, #lstrip, #lstrip!, #match, #next, #next!, #oct, #replace, #reverse, #reverse!, #rindex, #rjust, #rstrip, #rstrip!, #scan, #size, #slice, #slice!, #split, #squeeze, #strip, #strip!, #strip_scripts, #sub, #sub!, #succ, #succ!, #sum, #swapcase, #swapcase!, #to_f, #to_i, #to_s, #to_str, #to_sym, #tr, #tr!, #tr_s, #tr_s!, #upcase, #upcase!, #upto
Constructor Details
#initialize(*element_sexps) ⇒ Symbol
- :lit, symbol
- :dsym, “foo”, expression, expression, …
130 131 132 133 134 135 |
# File 'lib/red/nodes/literal_nodes.rb', line 130 def initialize(*element_sexps) = element_sexps.pop elements = element_sexps.map {|element_sexp| element_sexp.red!(.merge(:as_argument => true, :as_string_element => true)) }.join(",") string = element_sexps.size > 1 ? "$S(%s)" : "$s(%s)" self << string % [elements] end |