Module: Opal::Connect::ConnectPlugins::Scope::ClassMethods

Defined in:
lib/opal/connect/plugins/scope.rb

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

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



40
41
42
43
44
45
46
# File 'lib/opal/connect/plugins/scope.rb', line 40

def method_missing(method, *args, &block)
  if scope && scope.respond_to?(method, true)
    scope.send(method, *args, &block)
  else
    super
  end
end

Instance Method Details

#scope(new_scope = false, *args) ⇒ Object



32
33
34
35
36
37
38
# File 'lib/opal/connect/plugins/scope.rb', line 32

def scope(new_scope = false, *args)
  if new_scope
    @_scope = new(*args).scope(new_scope || Connect.options[:scope])
  else
    @_scope ||= Connect.options[:scope]
  end
end