metaprogramming.rb

Rubyエキスパート

Explorer

C40
C++40
C#40
Dart40
Go40
Java40
JavaScript40
Kotlin40
Objective-C40
Perl40
PHP40
Python40
R40
Ruby
初級10
中級10
上級10
エキスパート5
singleton_class.rb
metaprogramming.rb
fiber_async.rb
method_missing.rb
module_prepend.rb
マスター5
Rust40
Shell40
Swift40
TypeScript40
metaprogramming.rb
Click to focus
1
2
3
4
5
6
7
8
class Model
 def self.attr_accessor_with_history(*attrs)
   attrs.each do |attr|
     define_method(attr) { instance_variable_get("@#{attr}") }
     define_method("#{attr}=") { |v| instance_variable_set("@#{attr}", v) }
   end
 end
end
0WPM0%0:000/235(0%)|Ln 1, Col 1
UTF-8Ruby

関連する練習問題