Module: Opal::Connect::ConnectPlugins::Scope::InstanceMethods

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



22
23
24
25
26
27
28
# File 'lib/opal/connect/plugins/scope.rb', line 22

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

Instance Method Details

#scope(new_scope = false) ⇒ Object



12
13
14
15
16
17
18
19
20
# File 'lib/opal/connect/plugins/scope.rb', line 12

def scope(new_scope = false)
  if new_scope
    @scope = new_scope

    self
  else
    @scope
  end
end