File: controller.rb

package info (click to toggle)
mikutter 5.0.4%2Bdfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 9,700 kB
  • sloc: ruby: 21,307; sh: 181; makefile: 19
file content (39 lines) | stat: -rw-r--r-- 609 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# -*- coding: utf-8 -*-

class Plugin::ChangeAccount::WorldGenerator::Controller
  include Gtk::FormDSL

  def create_inner_setting
    self.class.new(@plugin)
  end

  def initialize(plugin, &block)
    super()
    @plugin = plugin
    @values = Hash.new
    if block_given?
      instance_eval(&block)
    end
  end

  def [](key)
    @values[key.to_sym]
  end

  def []=(key, value)
    @values[key.to_sym] = value
  end

  def to_h(&block)
    if block
      @values.to_h(&block)
    else
      @values.dup
    end
  end

  def method_missing(*args, &block)
    @plugin.__send__(*args, &block)
  end

end