Class: Kestrel::Client::Envelope
- Defined in:
- lib/kestrel/client/envelope.rb
Instance Attribute Summary collapse
-
#envelope_class ⇒ Object
Returns the value of attribute envelope_class.
Attributes inherited from Proxy
Instance Method Summary collapse
- #get(*args) ⇒ Object
-
#initialize(envelope_class, client) ⇒ Envelope
constructor
A new instance of Envelope.
- #set(key, value, *args) ⇒ Object
Methods inherited from Proxy
Constructor Details
#initialize(envelope_class, client) ⇒ Envelope
Returns a new instance of Envelope.
6 7 8 9 |
# File 'lib/kestrel/client/envelope.rb', line 6 def initialize(envelope_class, client) @envelope_class = envelope_class super(client) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Kestrel::Client::Proxy
Instance Attribute Details
#envelope_class ⇒ Object
Returns the value of attribute envelope_class.
4 5 6 |
# File 'lib/kestrel/client/envelope.rb', line 4 def envelope_class @envelope_class end |
Instance Method Details
#get(*args) ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/kestrel/client/envelope.rb', line 11 def get(*args) response = client.get(*args) if response.respond_to?(:unwrap) response.unwrap else response end end |
#set(key, value, *args) ⇒ Object
20 21 22 |
# File 'lib/kestrel/client/envelope.rb', line 20 def set(key, value, *args) client.set(key, envelope_class.new(value), *args) end |