Class: Musa::Series::Constructors::ProxySerie

Inherits:
Object
  • Object
show all
Defined in:
lib/musa-dsl/series/proxy-serie.rb

Instance Method Summary collapse

Constructor Details

#initialize(serie) ⇒ ProxySerie

Returns a new instance of ProxySerie.



12
13
14
15
# File 'lib/musa-dsl/series/proxy-serie.rb', line 12

def initialize(serie)
  self.proxy_source = serie
  init
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_name, *args, **key_args, &block) ⇒ Object (private)



25
26
27
28
29
30
31
32
33
34
35
# File 'lib/musa-dsl/series/proxy-serie.rb', line 25

private def method_missing(method_name, *args, **key_args, &block)
  if @source
    if @source.respond_to?(method_name)
      @source.send method_name, *args, **key_args, &block
    else
      raise NoMethodError, "undefined method '#{method_name}' for proxied #{@source.to_s}"
    end
  else
    super
  end
end