Module: SyncwiseApi::ServiceUtils::Encoders::JSON

Defined in:
lib/syncwise_api/service_utils/encoders/json.rb

Class Method Summary collapse

Class Method Details

.encode(object) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/syncwise_api/service_utils/encoders/json.rb', line 8

def encode(object)
  if object.is_a?(Hash) || object.is_a?(Array)
    Yajl::Encoder.encode(object)
  else
    fail SyncwiseApi::Errors::JSONEncodeError.new(object)
  end
end