Module: Halibut::Adapter::JSON::InstanceMethods

Defined in:
lib/halibut/adapter/json.rb

Instance Method Summary collapse

Instance Method Details

#to_jsonString

Deprecated.

This might go.

Returns a JSON representation of the resource.

Examples:

resource = Halibut::Core::Resource.new('/post')
resource.extend(Halibut::Adapter::JSON)
resource.to_json
# => "{\"_links\":{\"self\":{\"href\":\"/post\"}}}"

Returns:

  • (String)

    a JSON representation of the resource


57
58
59
60
# File 'lib/halibut/adapter/json.rb', line 57

def to_json
  warn "[Deprecation] Don't depend on this, as it might disappear soon."
  ::JSON.dump self.to_hash
end