Class: Array

Inherits:
Object show all
Defined in:
lib/plasma/interpreter/class_mods.rb

Instance Method Summary collapse

Instance Method Details

#to_hashObject



18
19
20
21
22
23
# File 'lib/plasma/interpreter/class_mods.rb', line 18

def to_hash
  hash = {}
  self.each {|key, value| hash[key] = value}

  return hash
end

#to_plasmaObject



25
26
27
28
29
30
31
# File 'lib/plasma/interpreter/class_mods.rb', line 25

def to_plasma
  plasma = self.map do |p|
    p.to_plasma
  end.join ' '

  return "[#{plasma}]"
end