Class: NSCoder

Inherits:
Object show all
Defined in:
lib/sugarcube/nscoder.rb

Instance Method Summary collapse

Instance Method Details

#[](key) ⇒ Object



3
4
5
# File 'lib/sugarcube/nscoder.rb', line 3

def [] key
  return self.decodeObjectForKey key
end

#[]=(key, value) ⇒ Object



7
8
9
# File 'lib/sugarcube/nscoder.rb', line 7

def []= key, value
  return self.encodeObject(value, forKey:key)
end

#bool(key) ⇒ Object



11
12
13
# File 'lib/sugarcube/nscoder.rb', line 11

def bool(key)
  return self.decodeBoolForKey(key)
end

#double(key) ⇒ Object



15
16
17
# File 'lib/sugarcube/nscoder.rb', line 15

def double(key)
  return self.decodeDoubleForKey(key)
end

#float(key) ⇒ Object



19
20
21
# File 'lib/sugarcube/nscoder.rb', line 19

def float(key)
  return self.decodeFloatForKey(key)
end

#int(key) ⇒ Object



23
24
25
# File 'lib/sugarcube/nscoder.rb', line 23

def int(key)
  return self.decodeIntegerForKey(key)
end

#point(key) ⇒ Object



27
28
29
# File 'lib/sugarcube/nscoder.rb', line 27

def point(key)
  return CGPointFromString(self.decodeObjectForKey(key))
end

#rect(key) ⇒ Object



31
32
33
# File 'lib/sugarcube/nscoder.rb', line 31

def rect(key)
  return CGRectFromString(self.decodeObjectForKey(key))
end

#set(key, toSize: value) ⇒ Object



39
40
41
42
# File 'lib/sugarcube/nscoder.rb', line 39

def set(key, toBool:value)
  self.encodeBool(value, forKey:key)
  return self
end

#size(key) ⇒ Object



35
36
37
# File 'lib/sugarcube/nscoder.rb', line 35

def size(key)
  return CGSizeFromString(self.decodeObjectForKey(key))
end