Skip to content

Instantly share code, notes, and snippets.

@carlosbrando
Created January 14, 2011 16:33
Show Gist options
  • Save carlosbrando/779835 to your computer and use it in GitHub Desktop.
Save carlosbrando/779835 to your computer and use it in GitHub Desktop.
Exemplo de configuração usando OpenStruct
require 'ostruct'
AppConfig = OpenStruct.new
AppConfig.default_email = "no-reply@example.com"
AppConfig.api_url = "staging.someapi.com"
@carlosbrando
Copy link
Author

Como AppConfig será acessível em todo o projeto, dá para usar esse recurso como uma forma de definir configurações globais.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment