Class: ActiveVlc::DSL::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/activevlc/dsl/base.rb

Direct Known Subclasses

Stream, Transcode, TranscodeAudio, TranscodeVideo

Instance Method Summary collapse

Constructor Details

#initialize(context) ⇒ Base

Returns a new instance of Base.



14
15
16
# File 'lib/activevlc/dsl/base.rb', line 14

def initialize(context)
  @context = context
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(sym, *args, &block) ⇒ Object



18
19
20
# File 'lib/activevlc/dsl/base.rb', line 18

def method_missing(sym, *args, &block)
  __option(normalize_option(sym), args.first, &block)
end

Instance Method Details

#param(name, value = nil) ⇒ Object Also known as: p



22
23
24
25
26
27
28
# File 'lib/activevlc/dsl/base.rb', line 22

def param(name, value = nil)
  if @context.parameters.has_param? name
    @context.parameters[name]
  else
    @context.parameters[name] = ActiveVlc::Parameter.new(name, value)
  end
end