Class: Nutrella::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/nutrella/configuration.rb

Overview

Knows the location and format of the configuration.

Constant Summary collapse

NULOGY_ORGANIZATION_ID =
"542d76ac2fad4697c3e80448"
INITIAL_CONFIGURATION =
<<~YAML
  # Trello Developer API Keys
  key: <your developer key>
  secret: <your developer secret>
  token: <your developer token>

  # Optional Configuration
  organization: #{NULOGY_ORGANIZATION_ID}
  launch_command: open $url$
  enable_trello_app: false
  enable_logging: false
  cache_capacity: 5
  cache_first: '^PM-\d+'
YAML

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ Configuration

Returns a new instance of Configuration.



33
34
35
36
37
# File 'lib/nutrella/configuration.rb', line 33

def initialize(path)
  @path = path

  load_configuration unless configuration_missing?
end

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path.



27
28
29
# File 'lib/nutrella/configuration.rb', line 27

def path
  @path
end

#valuesObject (readonly)

Returns the value of attribute values.



27
28
29
# File 'lib/nutrella/configuration.rb', line 27

def values
  @values
end

Class Method Details

.values(path) ⇒ Object



29
30
31
# File 'lib/nutrella/configuration.rb', line 29

def self.values(path)
  new(path).values
end