Class: StackEncode::Profile
- Inherits:
-
Object
- Object
- StackEncode::Profile
- Defined in:
- lib/stack-encode/profile.rb
Instance Method Summary collapse
- #audio_options ⇒ Object
-
#initialize(options = {}) ⇒ Profile
constructor
A new instance of Profile.
- #settings ⇒ Object
- #transcoder_options ⇒ Object
- #video_options ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Profile
Returns a new instance of Profile.
6 7 8 9 |
# File 'lib/stack-encode/profile.rb', line 6 def initialize( = {}) @profile_path = [:profile_path] ? [:profile_path] : nil @custom_options = [:custom_options] ? [:custom_options] : nil end |
Instance Method Details
#audio_options ⇒ Object
33 34 35 36 |
# File 'lib/stack-encode/profile.rb', line 33 def = settings['audio'] ? settings['audio'] : {} () end |
#settings ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/stack-encode/profile.rb', line 11 def settings @settings ||= if @profile_path begin YAML.load_file @profile_path rescue SystemCallError $stderr.puts "Can't find profile #{@profile_path}." exit 1 rescue => e $stderr.puts "Error parsing profile (#{@profile_path}):" $stderr.puts e. exit 1 end else {} end end |
#transcoder_options ⇒ Object
38 39 40 |
# File 'lib/stack-encode/profile.rb', line 38 def @settings['transcoder'] ? @settings['transcoder'] : {} end |
#video_options ⇒ Object
28 29 30 31 |
# File 'lib/stack-encode/profile.rb', line 28 def = settings['video'] ? settings['video'] : {} () end |