class Spectifly::Configuration
Attributes
entity_path[RW]
presenter_path[RW]
Public Class Methods
new(config = {})
click to toggle source
# File lib/spectifly/configuration.rb, line 6 def initialize(config = {}) @entity_path = config.fetch('entity_path') set_presenter_path(config['presenter_path']) end
Private Instance Methods
set_presenter_path(path = nil)
click to toggle source
# File lib/spectifly/configuration.rb, line 13 def set_presenter_path(path = nil) path = 'presenters' if path.nil? proposed_path = File.join(@entity_path, path) if Dir.exists?(proposed_path) @presenter_path = proposed_path else raise InvalidPresenterPath, "#{proposed_path} does not exist" end end