Class: Bl::Config

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/bl/config.rb

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



10
11
12
13
14
15
16
17
# File 'lib/bl/config.rb', line 10

def initialize
  file = ::File.join(Dir.home, Bl::CONFIG_FILE)
  if ::File.exist?(file)
    @config = YAML.load_file(file)
  else
    @config = nil
  end
end

Instance Method Details

#[](key) ⇒ Object



19
20
21
# File 'lib/bl/config.rb', line 19

def [](key)
  @config[key]
end

#default_configObject



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/bl/config.rb', line 23

def default_config
  {
    space_id: '',
    api_key: '',
    project_key: '',
    issue: {
      default: {
        projectId: nil,
        issueTypeId: nil,
        priorityId: 3,
        assigneeId: nil
      }
    }
  }
end