Class: RailsGraph::Inspector
- Inherits:
-
Object
- Object
- RailsGraph::Inspector
- Defined in:
- lib/rails_graph/inspector.rb
Instance Method Summary collapse
- #add_association(association) ⇒ Object
- #add_class(klass) ⇒ Object
-
#initialize ⇒ Inspector
constructor
A new instance of Inspector.
- #log ⇒ Object
Constructor Details
#initialize ⇒ Inspector
Returns a new instance of Inspector.
7 8 9 10 |
# File 'lib/rails_graph/inspector.rb', line 7 def initialize @classes = Set.new @associations = Set.new end |
Instance Method Details
#add_association(association) ⇒ Object
16 17 18 |
# File 'lib/rails_graph/inspector.rb', line 16 def add_association(association) @associations.add(association) end |
#add_class(klass) ⇒ Object
12 13 14 |
# File 'lib/rails_graph/inspector.rb', line 12 def add_class(klass) @classes.add(klass) end |
#log ⇒ Object
20 21 22 23 24 25 26 27 28 29 |
# File 'lib/rails_graph/inspector.rb', line 20 def log @classes.each do |klass| puts "[WARN][RailsGraph]: Invalid class configuration: #{klass}" end @associations.each do |association| puts "[WARN][RailsGraph]: #{association.name} association defined " \ "under #{association.active_record.name} class has invalid configurations!" end end |