Class: WebSocketVCR::RecordEntry
- Inherits:
-
Object
- Object
- WebSocketVCR::RecordEntry
- Defined in:
- lib/simple_websocket_vcr/cassette.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
-
#event ⇒ Object
Returns the value of attribute event.
-
#operation ⇒ Object
Returns the value of attribute operation.
-
#type ⇒ Object
Returns the value of attribute type.
Class Method Summary collapse
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
124 125 126 |
# File 'lib/simple_websocket_vcr/cassette.rb', line 124 def data @data end |
#event ⇒ Object
Returns the value of attribute event.
124 125 126 |
# File 'lib/simple_websocket_vcr/cassette.rb', line 124 def event @event end |
#operation ⇒ Object
Returns the value of attribute operation.
124 125 126 |
# File 'lib/simple_websocket_vcr/cassette.rb', line 124 def operation @operation end |
#type ⇒ Object
Returns the value of attribute type.
124 125 126 |
# File 'lib/simple_websocket_vcr/cassette.rb', line 124 def type @type end |
Class Method Details
.parse(obj, erb_variables = nil) ⇒ Object
126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 |
# File 'lib/simple_websocket_vcr/cassette.rb', line 126 def self.parse(obj, erb_variables = nil) record_entry = RecordEntry.new record_entry.operation = obj['operation'] record_entry.event = obj['event'] if obj['event'] record_entry.type = obj['type'] if obj['type'] record_entry.data = obj['data'] if obj['data'] # do the ERB substitution if erb_variables && record_entry.type != 'binary' require 'ostruct' namespace = OpenStruct.new(erb_variables) record_entry.data = ERB.new(record_entry.data).result(namespace.instance_eval { binding }) end record_entry end |