Module: ActiveResource::Connections::CoreExt::ClassMethods
- Defined in:
- lib/active_resource/connections/core_ext.rb
Instance Method Summary collapse
-
#connection_class ⇒ Object
Gets the class used to establish connection.
-
#connection_class=(klass) ⇒ Object
Sets the connection class for this model to the value in the
klass
argument.
Instance Method Details
#connection_class ⇒ Object
Gets the class used to establish connection.
27 28 29 30 31 32 33 34 35 |
# File 'lib/active_resource/connections/core_ext.rb', line 27 def connection_class if defined?(@connection_class) && @connection_class @connection_class elsif superclass != Object superclass.connection_class else ActiveResource::Connection end end |
#connection_class=(klass) ⇒ Object
Sets the connection class for this model to the value in the klass
argument. The klass
should inherit from ActiveResource::Connection.
39 40 41 42 |
# File 'lib/active_resource/connections/core_ext.rb', line 39 def connection_class=(klass) @connection = nil @connection_class = klass end |