Class: Spectifly::Configuration

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config = {}) ⇒ Configuration

Returns a new instance of Configuration.



4
5
6
7
# File 'lib/spectifly/configuration.rb', line 4

def initialize(config = {})
  @entity_path = config.fetch('entity_path')
  @presenter_path = config['presenter_path']
end

Instance Attribute Details

#entity_pathObject

Returns the value of attribute entity_path.



3
4
5
# File 'lib/spectifly/configuration.rb', line 3

def entity_path
  @entity_path
end

Instance Method Details

#presenter_pathObject



9
10
11
12
13
14
15
16
# File 'lib/spectifly/configuration.rb', line 9

def presenter_path
  @presenter_path ||= begin
    proposed_path = File.join(@entity_path, 'presenters')
    if Dir.exists?(proposed_path)
      @presenter_path = proposed_path
    end
  end
end