Class: RailsConsoleShield::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/rails_console_shield/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/rails_console_shield/configuration.rb', line 5

def initialize
  self.environment_prompt_colors = {
    development: :green,
    staging: :yellow,
    production: :red,
  }

  self.warn_text ="    WARNING: YOU ARE USING RAILS CONSOLE IN PRODUCTION!\n    Changing data can cause serious data loss.\n    Make sure you know what you're doing.\n  TEXT\n\n  self.shield_environments = %w[production]\nend\n"

Instance Attribute Details

#environment_prompt_colorsObject

Returns the value of attribute environment_prompt_colors.



3
4
5
# File 'lib/rails_console_shield/configuration.rb', line 3

def environment_prompt_colors
  @environment_prompt_colors
end

#shield_environmentsObject

Returns the value of attribute shield_environments.



3
4
5
# File 'lib/rails_console_shield/configuration.rb', line 3

def shield_environments
  @shield_environments
end

#warn_textObject

Returns the value of attribute warn_text.



3
4
5
# File 'lib/rails_console_shield/configuration.rb', line 3

def warn_text
  @warn_text
end