Class: ParamsReady::Helpers::RelationBuilderWrapper

Inherits:
Object
  • Object
show all
Defined in:
lib/params_ready/helpers/relation_builder_wrapper.rb

Instance Method Summary collapse

Constructor Details

#initialize(cache, *args, **opts) ⇒ RelationBuilderWrapper

Returns a new instance of RelationBuilderWrapper.



6
7
8
9
# File 'lib/params_ready/helpers/relation_builder_wrapper.rb', line 6

def initialize(cache, *args, **opts)
  @cache = cache
  @builder = Query::RelationParameterBuilder.instance *args, **opts
end

Instance Method Details

#capture(*names) ⇒ Object



11
12
13
14
15
16
# File 'lib/params_ready/helpers/relation_builder_wrapper.rb', line 11

def capture(*names)
  names.each do |name|
    definition = @cache.parameter_definition(name)
    @builder.add definition
  end
end

#respond_to_missing?(name, include_private = false) ⇒ Boolean

Returns:

  • (Boolean)


26
27
28
29
30
31
32
# File 'lib/params_ready/helpers/relation_builder_wrapper.rb', line 26

def respond_to_missing?(name, include_private = false)
  if @builder.respond_to? name
    true
  else
    super
  end
end