Class: MagicReport::Report::Configuration::HasOne

Inherits:
Object
  • Object
show all
Defined in:
lib/magic_report/report/configuration.rb

Direct Known Subclasses

HasMany

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#keyObject (readonly)

Returns the value of attribute key.



20
21
22
# File 'lib/magic_report/report/configuration.rb', line 20

def key
  @key
end

#klassObject (readonly)

Returns the value of attribute klass.



20
21
22
# File 'lib/magic_report/report/configuration.rb', line 20

def klass
  @klass
end

#optsObject (readonly)

Returns the value of attribute opts.



20
21
22
# File 'lib/magic_report/report/configuration.rb', line 20

def opts
  @opts
end

#prefixObject (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

#reportObject



33
34
35
# File 'lib/magic_report/report/configuration.rb', line 33

def report
  @report ||= init_report
end