Class: Rails::Schema::Configuration
- Inherits:
-
Object
- Object
- Rails::Schema::Configuration
- Defined in:
- lib/rails/schema/configuration.rb
Instance Attribute Summary collapse
-
#collapse_groups ⇒ Object
Returns the value of attribute collapse_groups.
-
#exclude_model_if ⇒ Object
Returns the value of attribute exclude_model_if.
-
#exclude_models ⇒ Object
Returns the value of attribute exclude_models.
-
#expand_columns ⇒ Object
Returns the value of attribute expand_columns.
-
#model_schema_group ⇒ Object
Returns the value of attribute model_schema_group.
-
#output_path ⇒ Object
Returns the value of attribute output_path.
-
#schema_format ⇒ Object
Returns the value of attribute schema_format.
-
#show_through_edges ⇒ Object
Returns the value of attribute show_through_edges.
-
#theme ⇒ Object
Returns the value of attribute theme.
-
#title ⇒ Object
Returns the value of attribute title.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #resolved_group_proc ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/rails/schema/configuration.rb', line 9 def initialize @output_path = "docs/schema.html" @exclude_models = [] @exclude_model_if = nil @title = "Database Schema" @theme = :auto @expand_columns = false @schema_format = :auto @model_schema_group = nil @collapse_groups = true @show_through_edges = true end |
Instance Attribute Details
#collapse_groups ⇒ Object
Returns the value of attribute collapse_groups.
6 7 8 |
# File 'lib/rails/schema/configuration.rb', line 6 def collapse_groups @collapse_groups end |
#exclude_model_if ⇒ Object
Returns the value of attribute exclude_model_if.
6 7 8 |
# File 'lib/rails/schema/configuration.rb', line 6 def exclude_model_if @exclude_model_if end |
#exclude_models ⇒ Object
Returns the value of attribute exclude_models.
6 7 8 |
# File 'lib/rails/schema/configuration.rb', line 6 def exclude_models @exclude_models end |
#expand_columns ⇒ Object
Returns the value of attribute expand_columns.
6 7 8 |
# File 'lib/rails/schema/configuration.rb', line 6 def @expand_columns end |
#model_schema_group ⇒ Object
Returns the value of attribute model_schema_group.
6 7 8 |
# File 'lib/rails/schema/configuration.rb', line 6 def model_schema_group @model_schema_group end |
#output_path ⇒ Object
Returns the value of attribute output_path.
6 7 8 |
# File 'lib/rails/schema/configuration.rb', line 6 def output_path @output_path end |
#schema_format ⇒ Object
Returns the value of attribute schema_format.
6 7 8 |
# File 'lib/rails/schema/configuration.rb', line 6 def schema_format @schema_format end |
#show_through_edges ⇒ Object
Returns the value of attribute show_through_edges.
6 7 8 |
# File 'lib/rails/schema/configuration.rb', line 6 def show_through_edges @show_through_edges end |
#theme ⇒ Object
Returns the value of attribute theme.
6 7 8 |
# File 'lib/rails/schema/configuration.rb', line 6 def theme @theme end |
#title ⇒ Object
Returns the value of attribute title.
6 7 8 |
# File 'lib/rails/schema/configuration.rb', line 6 def title @title end |
Instance Method Details
#resolved_group_proc ⇒ Object
22 23 24 25 26 27 28 29 30 31 |
# File 'lib/rails/schema/configuration.rb', line 22 def resolved_group_proc case @model_schema_group when nil then nil when :namespaces ->(model) { model.name.split("::")[0..-2] } when Proc then @model_schema_group else raise ArgumentError, "model_schema_group must be nil, :namespaces, or a Proc" end end |