class Filtrum::Settings

Public Class Methods

new(parent = nil) click to toggle source
# File lib/filtrum/settings.rb, line 5
def initialize parent = nil
  @parent = parent
  @type_serializers = []
end

Public Instance Methods

configure(&block) click to toggle source
# File lib/filtrum/settings.rb, line 10
def configure &block
  instance_eval &block if block
end
dsl() click to toggle source
# File lib/filtrum/settings.rb, line 22
def dsl
  m = Module.new do

    def serialize_type type, &block
      @settings.serialize_type type, &block
    end
  end
  m.instance_variable_set :@settings, self
  m
end
serialize_type(type, &block) click to toggle source
# File lib/filtrum/settings.rb, line 14
def serialize_type type, &block
  @type_serializers << TypeSerializer.new(type, block)
end
type_serializers() click to toggle source
# File lib/filtrum/settings.rb, line 18
def type_serializers
  (@parent ? @parent.type_serializers : []) + @type_serializers
end