Module: Sunzi::Cli::Database

Extended by:
Database
Included in:
Database
Defined in:
lib/sunzi/cli/database.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#envObject

Returns the value of attribute env.



5
6
7
# File 'lib/sunzi/cli/database.rb', line 5

def env
  @env
end

Instance Method Details

#load_env(stage) ⇒ Object



7
8
9
10
11
12
# File 'lib/sunzi/cli/database.rb', line 7

def load_env(stage)
  path = File.expand_path('config/database.yml')
  @env = YAML.load(File.read(path))[stage]
  scope_keys
  @env = HashWithIndifferentAccess.new(@env)
end