Class: Fairy::Filter

Inherits:
Object
  • Object
show all
Defined in:
lib/fairy/client/filter.rb

Instance Method Summary collapse

Constructor Details

#initialize(fairy, opts, *rests) ⇒ Filter

Returns a new instance of Filter.



29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/fairy/client/filter.rb', line 29

def initialize(fairy, opts, *rests)
  @fairy = fairy
  @opts = opts
  @opts = {} unless @opts
  if @opts[:BEGIN]
	@opts[:BEGIN] = BlockSource.new(@opts[:BEGIN])
  end
  if @opts[:END]
	@opts[:END] = BlockSource.new(@opts[:END])
  end
  @ref = backend_class.new(fairy.controller, opts, *rests)
end

Instance Method Details

#backendObject



49
50
51
# File 'lib/fairy/client/filter.rb', line 49

def backend
  @ref
end

#backend=(v) ⇒ Object



53
54
55
# File 'lib/fairy/client/filter.rb', line 53

def backend=(v)
  @ref=v
end

#backend_classObject



42
43
44
45
46
47
# File 'lib/fairy/client/filter.rb', line 42

def backend_class
  unless klass = @fairy.name2backend_class(backend_class_name)
	ERR::Raise ERR::INTERNAL::NoRegisterService, backend_class_name
  end
  klass
end

#def_pool_variable(vname, value = nil) ⇒ Object



57
58
59
# File 'lib/fairy/client/filter.rb', line 57

def def_pool_variable(vname, value = nil)
  backend.def_pool_variable(vname, value)
end