| 1 |
|
| 2 |
|
| 3 |
class Plugin::ChangeAccount::WorldGenerator::Controller |
| 4 |
include Gtk::FormDSL |
| 5 |
|
| 6 |
def create_inner_setting |
| 7 |
self.class.new(@plugin) |
| 8 |
end |
| 9 |
|
| 10 |
def initialize(plugin, &block) |
| 11 |
super() |
| 12 |
@plugin = plugin |
| 13 |
@values = Hash.new |
| 14 |
if block_given? |
| 15 |
instance_eval(&block) |
| 16 |
end |
| 17 |
end |
| 18 |
|
| 19 |
def [](key) |
| 20 |
@values[key.to_sym] |
| 21 |
end |
| 22 |
|
| 23 |
def []=(key, value) |
| 24 |
@values[key.to_sym] = value |
| 25 |
end |
| 26 |
|
| 27 |
def to_h(&block) |
| 28 |
if block |
| 29 |
@values.to_h(&block) |
| 30 |
else |
| 31 |
@values.dup |
| 32 |
end |
| 33 |
end |
| 34 |
|
| 35 |
def method_missing(*args, &block) |
| 36 |
@plugin.__send__(*args, &block) |
| 37 |
end |
| 38 |
|
| 39 |
end |