Sha256: 4459bbf196b35ccb743565b692be6a1d0ac30448cb6f6eb6a03da782a7610c31

Contents?: true

Size: 1.05 KB

Versions: 41

Compression:

Stored size: 1.05 KB

Contents

class HyperResource

  ## HyperResource::Adapter is the interface/abstract base class for 
  ## adapters to different hypermedia formats (e.g., HAL+JSON).  New
  ## adapters must implement the public methods of this class.

  class Adapter
    class << self

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

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

      ## Use a given deserialized response object (Hash) to update a given
      ## resource (HyperResource), returning the updated resource.
      def apply(response, resource, opts={})
        raise NotImplementedError, "This is an abstract method -- subclasses "+
          "of HyperResource::Adapter must implement it."
      end

    end
  end
end

Version data entries

41 entries across 41 versions & 4 rubygems

Version Path
aptible-resource-1.1.2 lib/hyper_resource/adapter.rb
aptible-resource-1.1.1 lib/hyper_resource/adapter.rb
aptible-resource-1.1.0 lib/hyper_resource/adapter.rb
aptible-resource-1.1.0.pre.0 lib/hyper_resource/adapter.rb
aptible-resource-1.0.2 lib/hyper_resource/adapter.rb
aptible-resource-1.0.1 lib/hyper_resource/adapter.rb
aptible-resource-1.0.0 lib/hyper_resource/adapter.rb
aptible-resource-0.5.0 lib/hyper_resource/adapter.rb
aptible-resource-0.4.0 lib/hyper_resource/adapter.rb
aptible-resource-0.3.8 lib/hyper_resource/adapter.rb
aptible-resource-0.3.7 lib/hyper_resource/adapter.rb
aptible-resource-0.3.6 lib/hyper_resource/adapter.rb
aptible-resource-0.3.5 lib/hyper_resource/adapter.rb
aptible-resource-0.3.4 lib/hyper_resource/adapter.rb
aptible-resource-0.3.3 lib/hyper_resource/adapter.rb
aptible-resource-0.3.2 lib/hyper_resource/adapter.rb
hyperresource-0.9.4 lib/hyper_resource/adapter.rb
hyperresource-0.9.3 lib/hyper_resource/adapter.rb
hyperresource-0.9.2 lib/hyper_resource/adapter.rb
aptible-resource-0.3.1 lib/hyper_resource/adapter.rb