Method: MultiJson#with_adapter

Defined in:
lib/multi_json.rb

#with_adapter(new_adapter) ⇒ Object Also known as: with_engine

Executes passed block using specified adapter.



133
134
135
136
137
138
139
# File 'lib/multi_json.rb', line 133

def with_adapter(new_adapter)
  old_adapter = adapter
  self.adapter = new_adapter
  yield
ensure
  self.adapter = old_adapter
end