Class: RailsMcp::Configuration
- Inherits:
-
Object
- Object
- RailsMcp::Configuration
- Defined in:
- lib/rails_mcp/configuration.rb
Instance Attribute Summary collapse
-
#allowed_models ⇒ Object
Returns the value of attribute allowed_models.
-
#database_role ⇒ Object
Returns the value of attribute database_role.
-
#default_fields ⇒ Object
Returns the value of attribute default_fields.
-
#denied_columns ⇒ Object
Returns the value of attribute denied_columns.
-
#denied_models ⇒ Object
Returns the value of attribute denied_models.
-
#max_limit ⇒ Object
Returns the value of attribute max_limit.
-
#max_offset ⇒ Object
Returns the value of attribute max_offset.
-
#schema_file ⇒ Object
Returns the value of attribute schema_file.
-
#scope ⇒ Object
Returns the value of attribute scope.
Instance Method Summary collapse
- #column_denied?(name) ⇒ Boolean
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/rails_mcp/configuration.rb', line 15 def initialize @database_role = :reading @default_fields = %i[id created_at updated_at] @allowed_models = [] @denied_models = [] @denied_columns = [] @max_limit = 100 @max_offset = 10_000 @schema_file = nil @scope = "mcp" end |
Instance Attribute Details
#allowed_models ⇒ Object
Returns the value of attribute allowed_models.
5 6 7 |
# File 'lib/rails_mcp/configuration.rb', line 5 def allowed_models @allowed_models end |
#database_role ⇒ Object
Returns the value of attribute database_role.
5 6 7 |
# File 'lib/rails_mcp/configuration.rb', line 5 def database_role @database_role end |
#default_fields ⇒ Object
Returns the value of attribute default_fields.
5 6 7 |
# File 'lib/rails_mcp/configuration.rb', line 5 def default_fields @default_fields end |
#denied_columns ⇒ Object
Returns the value of attribute denied_columns.
5 6 7 |
# File 'lib/rails_mcp/configuration.rb', line 5 def denied_columns @denied_columns end |
#denied_models ⇒ Object
Returns the value of attribute denied_models.
5 6 7 |
# File 'lib/rails_mcp/configuration.rb', line 5 def denied_models @denied_models end |
#max_limit ⇒ Object
Returns the value of attribute max_limit.
5 6 7 |
# File 'lib/rails_mcp/configuration.rb', line 5 def max_limit @max_limit end |
#max_offset ⇒ Object
Returns the value of attribute max_offset.
5 6 7 |
# File 'lib/rails_mcp/configuration.rb', line 5 def max_offset @max_offset end |
#schema_file ⇒ Object
Returns the value of attribute schema_file.
5 6 7 |
# File 'lib/rails_mcp/configuration.rb', line 5 def schema_file @schema_file end |
#scope ⇒ Object
Returns the value of attribute scope.
5 6 7 |
# File 'lib/rails_mcp/configuration.rb', line 5 def scope @scope end |
Instance Method Details
#column_denied?(name) ⇒ Boolean
27 28 29 30 31 |
# File 'lib/rails_mcp/configuration.rb', line 27 def column_denied?(name) denied_columns.any? do |pattern| pattern.is_a?(Regexp) ? pattern.match?(name.to_s) : pattern.to_s == name.to_s end end |