Class: AudioDicer::Context
- Inherits:
-
Object
- Object
- AudioDicer::Context
- Defined in:
- lib/audio_dicer/context.rb,
lib/audio_dicer/context/album.rb
Defined Under Namespace
Classes: Album
Instance Attribute Summary collapse
-
#albums ⇒ Object
readonly
Returns the value of attribute albums.
-
#source_options ⇒ Object
readonly
Returns the value of attribute source_options.
Instance Method Summary collapse
- #album(&block) ⇒ Object (also: #disc)
- #bitrate(bitrate) ⇒ Object
-
#initialize ⇒ Context
constructor
A new instance of Context.
- #source(source) ⇒ Object
Constructor Details
#initialize ⇒ Context
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
#albums ⇒ Object (readonly)
Returns the value of attribute albums.
3 4 5 |
# File 'lib/audio_dicer/context.rb', line 3 def albums @albums end |
#source_options ⇒ Object (readonly)
Returns the value of attribute source_options.
3 4 5 |
# File 'lib/audio_dicer/context.rb', line 3 def @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 |