Class: GitGrabber::Config
- Inherits:
-
Object
- Object
- GitGrabber::Config
- Defined in:
- lib/git_grabber/config.rb
Instance Attribute Summary collapse
-
#backup_directory ⇒ Object
Returns the value of attribute backup_directory.
-
#github_personal_token ⇒ Object
Returns the value of attribute github_personal_token.
-
#interval ⇒ Object
Returns the value of attribute interval.
Instance Method Summary collapse
-
#initialize(path) ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize(path) ⇒ Config
Returns a new instance of Config.
7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/git_grabber/config.rb', line 7 def initialize(path) config = JSON.parse(File.read path) %w{ interval github_personal_token backup_directory }.each do |required| if config[required].nil? raise "missing required config option #{required}" end end self.interval = config["interval"] self.github_personal_token = config["github_personal_token"] self.backup_directory = config["backup_directory"] end |
Instance Attribute Details
#backup_directory ⇒ Object
Returns the value of attribute backup_directory.
5 6 7 |
# File 'lib/git_grabber/config.rb', line 5 def backup_directory @backup_directory end |
#github_personal_token ⇒ Object
Returns the value of attribute github_personal_token.
5 6 7 |
# File 'lib/git_grabber/config.rb', line 5 def github_personal_token @github_personal_token end |
#interval ⇒ Object
Returns the value of attribute interval.
5 6 7 |
# File 'lib/git_grabber/config.rb', line 5 def interval @interval end |