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_hash) ⇒ Object
- #reset! ⇒ Object
Methods included from Client
Constructor Details
#initialize(*args) ⇒ TestClient
Returns a new instance of TestClient.
145 146 147 148 149 |
# File 'lib/qs/client.rb', line 145 def initialize(*args) super @redis = HellaRedis.mock(self.redis_connect_hash) @pushed_items = [] end |
Instance Attribute Details
#pushed_items ⇒ Object (readonly)
Returns the value of attribute pushed_items.
143 144 145 |
# File 'lib/qs/client.rb', line 143 def pushed_items @pushed_items end |
Instance Method Details
#push(queue_name, payload_hash) ⇒ Object
151 152 153 154 155 156 |
# File 'lib/qs/client.rb', line 151 def push(queue_name, payload_hash) # attempt to encode (and then throw away) the payload hash, this will # error on the developer if it can't be encoded Qs.encode(payload_hash) @pushed_items << PushedItem.new(queue_name, payload_hash) end |
#reset! ⇒ Object
158 159 160 |
# File 'lib/qs/client.rb', line 158 def reset! @pushed_items.clear end |