Class: Mongoid::Report::ReportProxy
- Inherits:
-
Struct
- Object
- Struct
- Mongoid::Report::ReportProxy
- Defined in:
- lib/mongoid/report/report_proxy.rb
Instance Attribute Summary collapse
-
#context ⇒ Object
Returns the value of attribute context.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
Instance Attribute Details
#context ⇒ Object
Returns the value of attribute context
6 7 8 |
# File 'lib/mongoid/report/report_proxy.rb', line 6 def context @context end |
#name ⇒ Object
Returns the value of attribute name
6 7 8 |
# File 'lib/mongoid/report/report_proxy.rb', line 6 def name @name end |
Instance Method Details
#attach_proxy ⇒ Object
7 8 9 10 11 |
# File 'lib/mongoid/report/report_proxy.rb', line 7 def attach_proxy @attach_proxy ||= begin AttachProxy.new(context, nil, report_module: name) end end |
#attach_to(*fields, &block) ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'lib/mongoid/report/report_proxy.rb', line 15 def attach_to(*fields, &block) = fields. model = fields[0] report_name = .delete(:as) || Collections.name(model) .merge!(report_module: name, as: report_name) context.attach_to(*fields, , &block) end |