Class: Array

Inherits:
Object show all
Defined in:
lib/carat-dev/association/association.rb,
lib/carat/snapshot.rb,
lib/carat-dev/misc/1.rb,
lib/carat-dev/import-module/import-module-0.81/lib/import-module.rb

Overview

of course we need to teach array about working with associations

Direct Known Subclasses

Association, FileList, Parser::Main, Tuple

Instance Method Summary collapse

Instance Method Details

#[](i) ⇒ Object



30
31
32
33
34
# File 'lib/carat-dev/association/association.rb', line 30

def [](i)
  r = self._get(i)
  return r.value if r.is_a? Association
  return r
end

#apply_snapshot(snap) ⇒ Object



67
68
69
# File 'lib/carat/snapshot.rb', line 67

def apply_snapshot(snap)
  replace(snap)
end

#at(i) ⇒ Object



38
39
40
41
42
# File 'lib/carat-dev/association/association.rb', line 38

def at(i)
  r = self._at(i)
  return r.value if r.is_a? Association
  return r
end

#take_snapshotObject



63
64
65
# File 'lib/carat/snapshot.rb', line 63

def take_snapshot
  dup
end

#values_at(*args) ⇒ Object



46
47
48
49
50
51
52
# File 'lib/carat-dev/association/association.rb', line 46

def values_at(*args)
  r = self.values_at(i)
  if r
    return r.collect{ |e| e.is_a?(Association) ? e.value : e }
  end
  return r
end