Module: Nsync::ClassMethods
- Defined in:
- lib/nsync/class_methods.rb
Instance Method Summary collapse
-
#nsync_consumer(opts = {}) ⇒ Object
Makes this class an Nsync Consumer.
- #nsync_opts ⇒ Object
- #nsync_opts=(hash_of_options) ⇒ Object
- #nsync_producer(opts = {}) ⇒ Object
Instance Method Details
#nsync_consumer(opts = {}) ⇒ Object
Makes this class an Nsync Consumer
5 6 7 |
# File 'lib/nsync/class_methods.rb', line 5 def nsync_consumer(opts={}) self.nsync_opts = {:id_key => :source_id}.merge(opts) end |
#nsync_opts ⇒ Object
18 19 20 21 |
# File 'lib/nsync/class_methods.rb', line 18 def nsync_opts return @nsync_opts unless superclass && superclass.respond_to?(:nsync_opts) @nsync_opts ||= superclass.nsync_opts.clone end |
#nsync_opts=(hash_of_options) ⇒ Object
14 15 16 |
# File 'lib/nsync/class_methods.rb', line 14 def nsync_opts=() @nsync_opts = end |
#nsync_producer(opts = {}) ⇒ Object
9 10 11 12 |
# File 'lib/nsync/class_methods.rb', line 9 def nsync_producer(opts={}) self.nsync_opts = {:id_key => :id}.merge(opts) include Nsync::Producer::InstanceMethods end |