Class: GithubBackup::Config
- Inherits:
-
Object
- Object
- GithubBackup::Config
- Defined in:
- lib/github-backup/config.rb
Constant Summary collapse
- DEFAULTS =
{ :gitconfig_path => "#{ENV['HOME']}/.gitconfig", }
Instance Attribute Summary collapse
-
#backup_root ⇒ Object
readonly
Returns the value of attribute backup_root.
-
#gitconfig_path ⇒ Object
readonly
Returns the value of attribute gitconfig_path.
-
#token ⇒ Object
readonly
Returns the value of attribute token.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize(options = {}) ⇒ Config
Returns a new instance of Config.
10 11 12 13 14 |
# File 'lib/github-backup/config.rb', line 10 def initialize( = {}) @backup_root = .fetch(:backup_root) { raise ArgumentError, 'A backup_root option is required' } @gitconfig_path = .fetch(:gitconfig_path) { DEFAULTS[:gitconfig_path] } @token = .fetch(:token) { default_token } end |
Instance Attribute Details
#backup_root ⇒ Object (readonly)
Returns the value of attribute backup_root.
8 9 10 |
# File 'lib/github-backup/config.rb', line 8 def backup_root @backup_root end |
#gitconfig_path ⇒ Object (readonly)
Returns the value of attribute gitconfig_path.
8 9 10 |
# File 'lib/github-backup/config.rb', line 8 def gitconfig_path @gitconfig_path end |
#token ⇒ Object (readonly)
Returns the value of attribute token.
8 9 10 |
# File 'lib/github-backup/config.rb', line 8 def token @token end |