4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
# File 'lib/app_store/helpers/plist.rb', line 4
def plist(params = {})
mapping = params[:mapping].collect do |plist_key, attr_name|
class_eval "attr_reader :#{attr_name}"
"@#{attr_name} = plist['#{plist_key}']"
end rescue []
class_eval " protected\n def init_from_plist(plist)\n \#{\"raise AppStore::ParseError unless plist['type'] == '\#{params[:accepted_type]}'\" if params[:accepted_type]}\n super\n \#{mapping.join(\"\\n\")}\n end\n EOV\nend\n", __FILE__, __LINE__
|