Class: AudioGlue::Snippet
- Inherits:
-
Object
- Object
- AudioGlue::Snippet
- Defined in:
- lib/audio_glue/snippet.rb
Overview
Represents an audio partial which will be used to build an output audio. There are a few types of snippets:
-
:file - represents audio file in local file system
-
:url - represents remote audio file
Other custom types can be created if custom adapter will support them.
adapters are responsible for processing every particular snippet type.
Instance Attribute Summary collapse
-
#opts ⇒ Object
readonly
Returns the value of attribute opts.
-
#snippet_packet ⇒ Object
readonly
Returns the value of attribute snippet_packet.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#-@ ⇒ void
Add self to the snippet packet.
-
#initialize(type, source, snippet_packet, opts = {}) ⇒ Snippet
constructor
A new instance of Snippet.
Constructor Details
#initialize(type, source, snippet_packet, opts = {}) ⇒ Snippet
Returns a new instance of Snippet.
20 21 22 23 24 25 |
# File 'lib/audio_glue/snippet.rb', line 20 def initialize(type, source, snippet_packet, opts = {}) @type = type @source = source @snippet_packet = snippet_packet @opts = opts end |
Instance Attribute Details
#opts ⇒ Object (readonly)
Returns the value of attribute opts.
12 13 14 |
# File 'lib/audio_glue/snippet.rb', line 12 def opts @opts end |
#snippet_packet ⇒ Object (readonly)
Returns the value of attribute snippet_packet.
12 13 14 |
# File 'lib/audio_glue/snippet.rb', line 12 def snippet_packet @snippet_packet end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
12 13 14 |
# File 'lib/audio_glue/snippet.rb', line 12 def source @source end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
12 13 14 |
# File 'lib/audio_glue/snippet.rb', line 12 def type @type end |
Instance Method Details
#-@ ⇒ void
This method returns an undefined value.
Add self to the snippet packet. It’s used to support dash syntax in .glue
files, like:
- file('/audio.mp3')
32 33 34 |
# File 'lib/audio_glue/snippet.rb', line 32 def -@ @snippet_packet << self end |