Class: Driskell::Listen::Adapter::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/driskell-listen/adapter/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(directories, queue, silencer, adapter_options) ⇒ Config

Returns a new instance of Config.



11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/driskell-listen/adapter/config.rb', line 11

def initialize(directories, queue, silencer, adapter_options)
  # Default to current directory if no directories are supplied
  directories = [Dir.pwd] if directories.to_a.empty?
  
  # TODO: fix (flatten, array, compact?)
  @directories = directories.map do |directory|
    Pathname.new(directory.to_s).realpath
  end

  @silencer = silencer
  @queue = queue
  @adapter_options = adapter_options
end

Instance Attribute Details

#adapter_optionsObject (readonly)

Returns the value of attribute adapter_options.



9
10
11
# File 'lib/driskell-listen/adapter/config.rb', line 9

def adapter_options
  @adapter_options
end

#directoriesObject (readonly)

Returns the value of attribute directories.



6
7
8
# File 'lib/driskell-listen/adapter/config.rb', line 6

def directories
  @directories
end

#queueObject (readonly)

Returns the value of attribute queue.



8
9
10
# File 'lib/driskell-listen/adapter/config.rb', line 8

def queue
  @queue
end

#silencerObject (readonly)

Returns the value of attribute silencer.



7
8
9
# File 'lib/driskell-listen/adapter/config.rb', line 7

def silencer
  @silencer
end