Class: SlashMigrate::Configuration

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

Overview

Host apps tune the engine through SlashMigrate.configure. Both values are read at route-draw time (see Engine), so a host initializer can override them even though the engine mounts itself.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



8
9
10
11
# File 'lib/slash_migrate/configuration.rb', line 8

def initialize
  @mount_path = "/rails/migrate"
  @enabled_environments = ["development"]
end

Instance Attribute Details

#enabled_environmentsObject

Returns the value of attribute enabled_environments.



6
7
8
# File 'lib/slash_migrate/configuration.rb', line 6

def enabled_environments
  @enabled_environments
end

#mount_pathObject

Returns the value of attribute mount_path.



6
7
8
# File 'lib/slash_migrate/configuration.rb', line 6

def mount_path
  @mount_path
end

Instance Method Details

#enabled_in?(env) ⇒ Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/slash_migrate/configuration.rb', line 13

def enabled_in?(env)
  enabled_environments.map(&:to_s).include?(env.to_s)
end