Class: Stellr::ClientCollection
- Inherits:
-
Object
- Object
- Stellr::ClientCollection
- 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
Instance Method Summary collapse
-
#disconnect ⇒ Object
Disconnects this collection from the server.
-
#initialize(server, name) ⇒ ClientCollection
constructor
A new instance of ClientCollection.
- #method_missing(method, *args) ⇒ Object
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
#disconnect ⇒ Object
Disconnects this collection from the server.
57 58 59 |
# File 'lib/stellr/client.rb', line 57 def disconnect @server = nil end |