Class: Qs::TestClient
Defined Under Namespace
Classes: PushedItem
Instance Attribute Summary collapse
-
#pushed_items ⇒ Object
readonly
Returns the value of attribute pushed_items.
Instance Method Summary collapse
-
#initialize(*args) ⇒ TestClient
constructor
A new instance of TestClient.
- #push(queue_name, payload) ⇒ Object
- #reset! ⇒ Object
Methods included from Client
Constructor Details
#initialize(*args) ⇒ TestClient
Returns a new instance of TestClient.
94 95 96 97 98 99 |
# File 'lib/qs/client.rb', line 94 def initialize(*args) super require 'hella-redis/connection_spy' @redis = HellaRedis::ConnectionSpy.new(self.redis_config) @pushed_items = [] end |
Instance Attribute Details
#pushed_items ⇒ Object (readonly)
Returns the value of attribute pushed_items.
92 93 94 |
# File 'lib/qs/client.rb', line 92 def pushed_items @pushed_items end |
Instance Method Details
#push(queue_name, payload) ⇒ Object
101 102 103 104 105 106 |
# File 'lib/qs/client.rb', line 101 def push(queue_name, payload) # attempt to serialize (and then throw away) the payload, this will error # on the developer if it can't be serialized Qs.serialize(payload) @pushed_items << PushedItem.new(queue_name, payload) end |
#reset! ⇒ Object
108 109 110 |
# File 'lib/qs/client.rb', line 108 def reset! @pushed_items.clear end |