Sha256: bd03bc6cff536f866f243f1b1ebc0de008c50a3a4de75689e74c98cf26604534

Contents?: true

Size: 848 Bytes

Versions: 6

Compression:

Stored size: 848 Bytes

Contents

class HyperResource
  class Adapter
    class << self

      ## Serialize the object into a string.
      def serialize(object)
        raise NotImplementedError, "This is an abstract method -- subclasses "+
          "of HyperResource::Adapter must implement it."
      end

      ## Deserialize a string into an object.
      def deserialize(string)
        raise NotImplementedError, "This is an abstract method -- subclasses "+
          "of HyperResource::Adapter must implement it."
      end

      ## Apply a response object (generally parsed JSON or XML) to the given
      ## HyperResource object.  Returns the updated resource.
      def apply(object, resource, opts={})
        raise NotImplementedError, "This is an abstract method -- subclasses "+
          "of HyperResource::Adapter must implement it."
      end

    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
hyperresource-0.2.0 lib/hyper_resource/adapter.rb
hyperresource-0.1.9.5 lib/hyper_resource/adapter.rb
hyperresource-0.1.9.4 lib/hyper_resource/adapter.rb
hyperresource-0.1.9.3 lib/hyper_resource/adapter.rb
hyperresource-0.1.9.2 lib/hyper_resource/adapter.rb
hyperresource-0.1.9 lib/hyper_resource/adapter.rb