Module: MagicReport::Report::ClassHelpers
- Included in:
- MagicReport::Report
- Defined in:
- lib/magic_report/report/class_helpers.rb
Instance Method Summary collapse
- #fields_from_class ⇒ Object
- #has_many_from_class ⇒ Object
- #has_one_from_class ⇒ Object
- #name_from_class ⇒ Object
Instance Method Details
#fields_from_class ⇒ Object
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_class ⇒ Object
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_class ⇒ Object
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_class ⇒ Object
6 7 8 |
# File 'lib/magic_report/report/class_helpers.rb', line 6 def name_from_class ::MagicReport::Utils.underscore(self.class.name) end |