Module: MagicReport::Report::ClassHelpers

Included in:
MagicReport::Report
Defined in:
lib/magic_report/report/class_helpers.rb

Instance Method Summary collapse

Instance Method Details

#fields_from_classObject



10
11
12
# File 'lib/magic_report/report/class_helpers.rb', line 10

def fields_from_class
  self.class.instance_variable_get(:@fields) || []
end

#has_many_from_classObject



18
19
20
# File 'lib/magic_report/report/class_helpers.rb', line 18

def has_many_from_class
  self.class.instance_variable_get(:@has_many) || []
end

#has_one_from_classObject



14
15
16
# File 'lib/magic_report/report/class_helpers.rb', line 14

def has_one_from_class
  self.class.instance_variable_get(:@has_one) || []
end

#name_from_classObject



6
7
8
# File 'lib/magic_report/report/class_helpers.rb', line 6

def name_from_class
  ::MagicReport::Utils.underscore(self.class.name)
end