Module: RailsConnector::Meta::ClassMethods

Defined in:
lib/meta.rb

Overview

the methods in this module will become class methods

Instance Method Summary collapse

Instance Method Details

#is_custom_ruby_class?Boolean

RailsConnector::AbstractObj returns false, everything else true.

Returns:

  • (Boolean)


136
137
138
# File 'lib/meta.rb', line 136

def is_custom_ruby_class?
  self != RailsConnector::AbstractObj
end

#obj_class_definitionObject Also known as: obj_class_def

The RailsConnector::ObjClass object for this file format. This will only return a proper object if a custom Ruby class exists and will throw a RuntimeError otherwise.



127
128
129
130
131
132
# File 'lib/meta.rb', line 127

def obj_class_definition
  raise "Obtaining the obj_class_definition of an Obj without custom Ruby class " \
            "is logically impossible." unless is_custom_ruby_class?
  # @obj_class_definition ||= RailsConnector::ObjClass.find_by_name(self.name)
  @obj_class_definition ||= RailsConnector::Meta::EagerLoader.instance.obj_class(self.name)
end