Class: Mongoid::Report::AttachProxy

Inherits:
Struct
  • Object
show all
Defined in:
lib/mongoid/report/attach_proxy.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(context, collection, options) ⇒ AttachProxy

Returns a new instance of AttachProxy.



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/mongoid/report/attach_proxy.rb', line 7

def initialize(context, collection, options)
  # Lets remove as option because of passing to the next blocks options
  report_name = options.delete(:as)

  if collection
    report_name ||= Collections.name(collection)
  end

  options.merge!(
    report_name:  report_name,
    collection:   collection,
  )

  super(context, collection, options)
end

Instance Attribute Details

#collectionObject

Returns the value of attribute collection

Returns:

  • (Object)

    the current value of collection



4
5
6
# File 'lib/mongoid/report/attach_proxy.rb', line 4

def collection
  @collection
end

#contextObject

Returns the value of attribute context

Returns:

  • (Object)

    the current value of context



4
5
6
# File 'lib/mongoid/report/attach_proxy.rb', line 4

def context
  @context
end

#optionsObject

Returns the value of attribute options

Returns:

  • (Object)

    the current value of options



4
5
6
# File 'lib/mongoid/report/attach_proxy.rb', line 4

def options
  @options
end

#report_nameObject (readonly)

Returns the value of attribute report_name.



5
6
7
# File 'lib/mongoid/report/attach_proxy.rb', line 5

def report_name
  @report_name
end

Instance Method Details

#batches(*fields) ⇒ Object



59
60
61
62
63
# File 'lib/mongoid/report/attach_proxy.rb', line 59

def batches(*fields)
  proxy_options = fields.extract_options!
  proxy_options.merge!(options)
  context.batches(*fields, proxy_options)
end

#column(*fields) ⇒ Object



29
30
31
32
33
# File 'lib/mongoid/report/attach_proxy.rb', line 29

def column(*fields)
  proxy_options = fields.extract_options!
  proxy_options.merge!(options)
  context.column(*fields, proxy_options)
end

#columns(*fields) ⇒ Object



23
24
25
26
27
# File 'lib/mongoid/report/attach_proxy.rb', line 23

def columns(*fields)
  proxy_options = fields.extract_options!
  proxy_options.merge!(options)
  context.columns(*fields, proxy_options)
end

#group_by(*fields) ⇒ Object



41
42
43
44
45
# File 'lib/mongoid/report/attach_proxy.rb', line 41

def group_by(*fields)
  proxy_options = fields.extract_options!
  proxy_options.merge!(options)
  context.group_by(*fields, proxy_options)
end

#mapping(*fields) ⇒ Object



35
36
37
38
39
# File 'lib/mongoid/report/attach_proxy.rb', line 35

def mapping(*fields)
  proxy_options = fields.extract_options!
  proxy_options.merge!(options)
  context.mapping(*fields, proxy_options)
end

#match(*fields) ⇒ Object



47
48
49
50
51
# File 'lib/mongoid/report/attach_proxy.rb', line 47

def match(*fields)
  proxy_options = fields.extract_options!
  proxy_options.merge!(options)
  context.match(*fields, proxy_options)
end

#query(*fields) ⇒ Object



53
54
55
56
57
# File 'lib/mongoid/report/attach_proxy.rb', line 53

def query(*fields)
  proxy_options = fields.extract_options!
  proxy_options.merge!(options)
  context.query(*fields, proxy_options)
end