Class: Coinbase::Generators::InitializeGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/coinbase/initialize_generator.rb

Instance Method Summary collapse

Instance Method Details

#create_initializer_fileObject



5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/generators/coinbase/initialize_generator.rb', line 5

def create_initializer_file
  yaml_file = {
    development: {
      url: "https://api-public.sandbox.exchange.coinbase.com",
      api_key: "",
      api_secret: "",
      passphrase: ""
    }
  }

  create_file 'config/coinbase.yml', yaml_file.to_yaml
  create_file 'config/initializers/coinbase.rb',
    "COINBASE_CONFIG = YAML.load_file(Rails.root.join('config', 'coinbase.yml')).with_indifferent_access[Rails.env]"
end