Class: Mongoid::Report::AttachProxy
- Inherits:
-
Struct
- Object
- Struct
- Mongoid::Report::AttachProxy
- Defined in:
- lib/mongoid/report/attach_proxy.rb
Instance Attribute Summary collapse
-
#collection ⇒ Object
Returns the value of attribute collection.
-
#context ⇒ Object
Returns the value of attribute context.
-
#options ⇒ Object
Returns the value of attribute options.
-
#report_name ⇒ Object
readonly
Returns the value of attribute report_name.
Instance Method Summary collapse
- #batches(*fields) ⇒ Object
- #column(*fields) ⇒ Object
- #columns(*fields) ⇒ Object
- #group_by(*fields) ⇒ Object
-
#initialize(context, collection, options) ⇒ AttachProxy
constructor
A new instance of AttachProxy.
- #mapping(*fields) ⇒ Object
- #match(*fields) ⇒ Object
- #query(*fields) ⇒ Object
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, ) # Lets remove as option because of passing to the next blocks options report_name = .delete(:as) if collection report_name ||= Collections.name(collection) end .merge!( report_name: report_name, collection: collection, ) super(context, collection, ) end |
Instance Attribute Details
#collection ⇒ Object
Returns the value of attribute collection
4 5 6 |
# File 'lib/mongoid/report/attach_proxy.rb', line 4 def collection @collection end |
#context ⇒ Object
Returns the value of attribute context
4 5 6 |
# File 'lib/mongoid/report/attach_proxy.rb', line 4 def context @context end |
#options ⇒ Object
Returns the value of attribute options
4 5 6 |
# File 'lib/mongoid/report/attach_proxy.rb', line 4 def end |
#report_name ⇒ Object (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) = fields. .merge!() context.batches(*fields, ) end |
#column(*fields) ⇒ Object
29 30 31 32 33 |
# File 'lib/mongoid/report/attach_proxy.rb', line 29 def column(*fields) = fields. .merge!() context.column(*fields, ) end |
#columns(*fields) ⇒ Object
23 24 25 26 27 |
# File 'lib/mongoid/report/attach_proxy.rb', line 23 def columns(*fields) = fields. .merge!() context.columns(*fields, ) end |
#group_by(*fields) ⇒ Object
41 42 43 44 45 |
# File 'lib/mongoid/report/attach_proxy.rb', line 41 def group_by(*fields) = fields. .merge!() context.group_by(*fields, ) end |
#mapping(*fields) ⇒ Object
35 36 37 38 39 |
# File 'lib/mongoid/report/attach_proxy.rb', line 35 def mapping(*fields) = fields. .merge!() context.mapping(*fields, ) end |
#match(*fields) ⇒ Object
47 48 49 50 51 |
# File 'lib/mongoid/report/attach_proxy.rb', line 47 def match(*fields) = fields. .merge!() context.match(*fields, ) end |
#query(*fields) ⇒ Object
53 54 55 56 57 |
# File 'lib/mongoid/report/attach_proxy.rb', line 53 def query(*fields) = fields. .merge!() context.query(*fields, ) end |