class Captcher::Config

Public Class Methods

new() { |self| ... } click to toggle source
Calls superclass method
# File lib/captcher/config.rb, line 3
def initialize
  super
  yield(self) if block_given?
end

Public Instance Methods

merge(other) click to toggle source
# File lib/captcher/config.rb, line 8
def merge(other)
  to_h.merge(other.to_h)
end
method_missing(name, *args) { |branch| ... } click to toggle source
Calls superclass method
# File lib/captcher/config.rb, line 16
def method_missing(name, *args)
  if block_given?
    branch = self.class.new
    yield(branch)
    args = [branch]
  end
  name = to_writer(name, args)
  super
end
respond_to_missing?() click to toggle source
# File lib/captcher/config.rb, line 12
def respond_to_missing?
  true
end
to_h() click to toggle source
Calls superclass method
# File lib/captcher/config.rb, line 26
def to_h
  attributes = super
  attributes.map do |key, value|
    if value.class == self.class
      [key, value.to_h]
    else
      [key, value]
    end
  end.to_h
end
to_writer(name, args) click to toggle source
# File lib/captcher/config.rb, line 37
def to_writer(name, args)
  args && (name !~ /=$/) ? "#{name}=" : name
end