Class: Stellr::ClientCollection

Inherits:
Object
  • Object
show all
Defined in:
lib/stellr/client.rb

Overview

Wrapper around a remote collection.

See the documentation of the collection class you use for more information.

Direct Known Subclasses

MultiCollection

Instance Method Summary collapse

Constructor Details

#initialize(server, name) ⇒ ClientCollection

Returns a new instance of ClientCollection.



51
52
53
54
# File 'lib/stellr/client.rb', line 51

def initialize( server, name )
  @name   = name
  @server = server
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args) ⇒ Object



61
62
63
64
# File 'lib/stellr/client.rb', line 61

def method_missing( method, *args )
  raise "use of disconnected collection" if @server.nil?
  @server.send method, @name, *args
end

Instance Method Details

#disconnectObject

Disconnects this collection from the server.



57
58
59
# File 'lib/stellr/client.rb', line 57

def disconnect
  @server = nil
end