Module: Higan::ConfigurationReceiver::ClassMethods
- Defined in:
- lib/higan/configuration_receiver.rb
Instance Method Summary collapse
Instance Method Details
#out(&block) ⇒ Object
4 5 6 |
# File 'lib/higan/configuration_receiver.rb', line 4 def out(&block) new(&block).out end |
#receive(*names) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/higan/configuration_receiver.rb', line 8 def receive(*names) module_eval " attr_accessor \#{names.map { |n| \":_\#{n}\" }.join(',')}\n\n def initialize(&block)\n instance_eval(&block)\n end\n\n def out\n {\#{names.map { |n| \"\#{n}: _\#{n}\" }.join(',')}}\n end\n EOS\n\n names.each do |n|\n module_eval <<-EOS\n def \#{n}(value)\n self._\#{n} = value\n end\n EOS\n end\nend\n" |