class Plugin::Settings::Phantom

Setting DSLの、入れ子になったsettingsだけを抜き出すためのクラス。

Constants

MOCK

Attributes

detected[R]

Public Class Methods

new(plugin_slug, &block) click to toggle source
# File core/plugin/settings/phantom.rb, line 7
def initialize(plugin_slug, &block)
  @plugin_slug = plugin_slug
  @detected = Array.new
  begin
    instance_eval(&block)
  rescue
    @detected = [].freeze
  end
  @detected.freeze
end

Public Instance Methods

method_missing(name, *rest, &block) click to toggle source
# File core/plugin/settings/phantom.rb, line 28
def method_missing(name, *rest, &block)
  case name.to_sym
  when *Gtk::FormDSL.instance_methods
    MOCK
  else
    Plugin.instance(@plugin_slug).__send__(name, *rest, &block)
  end
end
settings(name, &block) click to toggle source
# File core/plugin/settings/phantom.rb, line 24
def settings(name, &block)
  @detected << Record.new(name, block, @plugin_slug)
end