class Ahnnotate::Facet::Models::ModuleNode
ModuleNode
is named as such since `Class.is_a?(Module) == true`.
Attributes
Named to fit the ModelSchema interface. This is the “outer class”
Named to fit the ModelSchema interface. This is basically `Class#name`
Named to fit the ModelSchema interface. This is the class that the current class inherits from. This is computed, whereas `claimed_superclass` is what is parsed from the source
Named to fit the ModelSchema interface. This is currently unsupported
Public Class Methods
# File lib/ahnnotate/facet/models/module_node.rb, line 33 def initialize(name, module_parent: nil, is_a_kind_of_activerecord_base: false, claimed_superclass: nil, explicit_table_name: nil, abstract_class: nil) self.name = name self.module_parent = parent self.is_a_kind_of_activerecord_base = is_a_kind_of_activerecord_base self.claimed_superclass = claimed_superclass self.explicit_table_name = explicit_table_name self.abstract_class = abstract_class end
Public Instance Methods
# File lib/ahnnotate/facet/models/module_node.rb, line 115 def <(other) other == ActiveRecord::Base && is_a_kind_of_activerecord_base? end
# File lib/ahnnotate/facet/models/module_node.rb, line 119 def ==(other) if is_active_record_base && other == ActiveRecord::Base return true end super end
Named to fit the ModelSchema interface
# File lib/ahnnotate/facet/models/module_node.rb, line 60 def abstract_class? !!@abstract_class end
Named to fit the ModelSchema interface. It was originally implemented in ActiveRecord::Inheritance. I've re-implemented it here via the documentation.
# File lib/ahnnotate/facet/models/module_node.rb, line 71 def base_class if superclass.is_active_record_base return self end if superclass.abstract_class? return self end superclass.base_class end
Named to fit the ModelSchema interface. It was originally implemented in ActiveRecord::Inheritance in Rails 6.0.
# File lib/ahnnotate/facet/models/module_node.rb, line 85 def base_class? base_class == self end
# File lib/ahnnotate/facet/models/module_node.rb, line 64 def claimed_superclass @claimed_superclass.to_s end
# File lib/ahnnotate/facet/models/module_node.rb, line 99 def class_name if @name "#{parent.class_name}::#{@name}" else "" end end
# File lib/ahnnotate/facet/models/module_node.rb, line 55 def is_a_kind_of_activerecord_base? !!@is_a_kind_of_activerecord_base end
Named to fit the ModelSchema interface. It was originally implemented in ActiveSupport::Introspection
# File lib/ahnnotate/facet/models/module_node.rb, line 91 def module_parents if module_parent [module_parent, *module_parent.module_parent] else [] end end
Named to fit the ModelSchema interface
# File lib/ahnnotate/facet/models/module_node.rb, line 48 def pluralize_table_names true end
# File lib/ahnnotate/facet/models/module_node.rb, line 107 def table_name if explicit_table_name return @explicit_table_name end super end
# File lib/ahnnotate/facet/models/module_node.rb, line 52 def table_name_suffix end