Class: HyperResource::Adapter

Inherits:
Object
  • Object
show all
Defined in:
lib/hyper_resource/adapter.rb,
lib/hyper_resource/adapter/hal_json.rb

Direct Known Subclasses

HAL_JSON

Defined Under Namespace

Classes: HAL_JSON

Class Method Summary collapse

Class Method Details

.apply(object, resource, opts = {}) ⇒ Object

Apply a response object (generally parsed JSON or XML) to the given HyperResource object. Returns the updated resource.

Raises:

  • (NotImplementedError)


19
20
21
22
# File 'lib/hyper_resource/adapter.rb', line 19

def apply(object, resource, opts={})
  raise NotImplementedError, "This is an abstract method -- subclasses "+
    "of HyperResource::Adapter must implement it."
end

.deserialize(string) ⇒ Object

Deserialize a string into an object.

Raises:

  • (NotImplementedError)


12
13
14
15
# File 'lib/hyper_resource/adapter.rb', line 12

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

.serialize(object) ⇒ Object

Serialize the object into a string.

Raises:

  • (NotImplementedError)


6
7
8
9
# File 'lib/hyper_resource/adapter.rb', line 6

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