[フレーム]
Last Updated: February 25, 2016
·
1.292K
· wilhelmbot

RubyMotion: A module for the NSCoding protocol

In RubyMotion you can use modules to stop duplicating code for protocols.

E.g.:

class User
 include Serializable
 attr_accessor :id, :name, :email
end

class Session
 include Serializable
 attr_accessor :last_access, :points
end

Gist: https://gist.github.com/4141258

AltStyle によって変換されたページ (->オリジナル) /