Class: RailsLens::Providers::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/rails_lens/providers/base.rb

Overview

Base class for all annotation content providers

Instance Method Summary collapse

Instance Method Details

#applicable?(_model_class) ⇒ Boolean

Returns true if this provider should process the given model

Returns:

  • (Boolean)


16
17
18
# File 'lib/rails_lens/providers/base.rb', line 16

def applicable?(_model_class)
  true
end

#process(model_class, connection = nil) ⇒ Object

Processes the model and returns content For :schema type - returns a string with the schema content For :section type - returns a hash with { title: String, content: String } or nil For :notes type - returns an array of note strings

Raises:

  • (NotImplementedError)


24
25
26
# File 'lib/rails_lens/providers/base.rb', line 24

def process(model_class, connection = nil)
  raise NotImplementedError, "#{self.class} must implement #process"
end

#typeObject

Returns the type of content this provider generates :schema - Primary schema information (only one allowed) :section - A named section with structured content :notes - Analysis notes and recommendations

Raises:

  • (NotImplementedError)


11
12
13
# File 'lib/rails_lens/providers/base.rb', line 11

def type
  raise NotImplementedError, "#{self.class} must implement #type"
end