Class: AudioFeedManager::Application

Inherits:
Object
  • Object
show all
Includes:
Dependor::AutoInject
Defined in:
lib/audio_feed_manager/application.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(directory:, stdin:, stderr:, stdout:) ⇒ Application

Returns a new instance of Application.



8
9
10
11
12
13
# File 'lib/audio_feed_manager/application.rb', line 8

def initialize(directory:, stdin:, stderr:, stdout:)
  @directory = Pathname.new(File.expand_path(directory))
  @stdin = stdin
  @stderr = stderr
  @stdout = stdout
end

Instance Attribute Details

#directoryObject (readonly)

Returns the value of attribute directory.



6
7
8
# File 'lib/audio_feed_manager/application.rb', line 6

def directory
  @directory
end

#stderrObject (readonly)

Returns the value of attribute stderr.



6
7
8
# File 'lib/audio_feed_manager/application.rb', line 6

def stderr
  @stderr
end

#stdinObject (readonly)

Returns the value of attribute stdin.



6
7
8
# File 'lib/audio_feed_manager/application.rb', line 6

def stdin
  @stdin
end

#stdoutObject (readonly)

Returns the value of attribute stdout.



6
7
8
# File 'lib/audio_feed_manager/application.rb', line 6

def stdout
  @stdout
end

Class Method Details

.let(name, &block) ⇒ Object



15
16
17
18
19
20
# File 'lib/audio_feed_manager/application.rb', line 15

def self.let(name, &block)
  define_method(name) do
    @object_cache ||= {}
    @object_cache[name] ||= instance_exec(&block)
  end
end