6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
# File 'lib/songkick/oauth2/model/hashing.rb', line 6
def hashes_attributes(*attributes)
attributes.each do |attribute|
define_method("#{attribute}=") do |value|
instance_variable_set("@#{attribute}", value)
__send__("#{attribute}_hash=", value && Songkick::OAuth2.hashify(value))
end
attr_reader attribute
end
class_eval " def reload(*args)\n super\n \#{ attributes.inspect }.each do |attribute|\n instance_variable_set('@' + attribute.to_s, nil)\n end\n end\n RUBY\nend\n"
|