Class: MagicReport::Report::Configuration::HasOne
- Inherits:
-
Object
- Object
- MagicReport::Report::Configuration::HasOne
- Defined in:
- lib/magic_report/report/configuration.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#klass ⇒ Object
readonly
Returns the value of attribute klass.
-
#opts ⇒ Object
readonly
Returns the value of attribute opts.
-
#prefix ⇒ Object
readonly
Returns the value of attribute prefix.
Instance Method Summary collapse
-
#initialize(klass:, opts:, key:) ⇒ HasOne
constructor
A new instance of HasOne.
- #process_entity(entity) ⇒ Object
- #report ⇒ Object
Constructor Details
#initialize(klass:, opts:, key:) ⇒ HasOne
Returns a new instance of HasOne.
22 23 24 25 26 27 |
# File 'lib/magic_report/report/configuration.rb', line 22 def initialize(klass:, opts:, key:) @klass = klass @prefix = opts[:prefix] @key = key @opts = opts end |
Instance Attribute Details
#key ⇒ Object (readonly)
Returns the value of attribute key.
20 21 22 |
# File 'lib/magic_report/report/configuration.rb', line 20 def key @key end |
#klass ⇒ Object (readonly)
Returns the value of attribute klass.
20 21 22 |
# File 'lib/magic_report/report/configuration.rb', line 20 def klass @klass end |
#opts ⇒ Object (readonly)
Returns the value of attribute opts.
20 21 22 |
# File 'lib/magic_report/report/configuration.rb', line 20 def opts @opts end |
#prefix ⇒ Object (readonly)
Returns the value of attribute prefix.
20 21 22 |
# File 'lib/magic_report/report/configuration.rb', line 20 def prefix @prefix end |
Instance Method Details
#process_entity(entity) ⇒ Object
29 30 31 |
# File 'lib/magic_report/report/configuration.rb', line 29 def process_entity(entity) report.process(entity) end |
#report ⇒ Object
33 34 35 |
# File 'lib/magic_report/report/configuration.rb', line 33 def report @report ||= init_report end |