Class: AudioDicer::Context

Inherits:
Object
  • Object
show all
Defined in:
lib/audio_dicer/context.rb,
lib/audio_dicer/context/album.rb

Defined Under Namespace

Classes: Album

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeContext

Returns a new instance of Context.



5
6
7
8
# File 'lib/audio_dicer/context.rb', line 5

def initialize
  @albums = []
  @source_options = {}
end

Instance Attribute Details

#albumsObject (readonly)

Returns the value of attribute albums.



3
4
5
# File 'lib/audio_dicer/context.rb', line 3

def albums
  @albums
end

#source_optionsObject (readonly)

Returns the value of attribute source_options.



3
4
5
# File 'lib/audio_dicer/context.rb', line 3

def source_options
  @source_options
end

Instance Method Details

#album(&block) ⇒ Object Also known as: disc



18
19
20
21
22
23
# File 'lib/audio_dicer/context.rb', line 18

def album(&block)
  album = Album.new
  album.instance_eval(&block)

  @albums << album
end

#bitrate(bitrate) ⇒ Object



14
15
16
# File 'lib/audio_dicer/context.rb', line 14

def bitrate(bitrate)
  @source_options.update bitrate: bitrate
end

#source(source) ⇒ Object



10
11
12
# File 'lib/audio_dicer/context.rb', line 10

def source(source)
  @source_options.update source: source
end