Class: Medie::Generic

Inherits:
Object
  • Object
show all
Defined in:
lib/medie/generic.rb

Overview

This is a simple implementation of a media type that provides no links and no marshalling, except the content itself. There is no parsing.

Instance Method Summary collapse

Instance Method Details

#can_handle?(media_type) ⇒ Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/medie/generic.rb', line 21

def can_handle?(media_type)
  true
end

#marshal(string, rel) ⇒ Object

Because there is no media type registered, return the string itself.



17
18
19
# File 'lib/medie/generic.rb', line 17

def marshal(string, rel)
  string
end

#unmarshal(content) ⇒ Object

Because there is no media type registered return the content itself



9
10
11
12
13
14
# File 'lib/medie/generic.rb', line 9

def unmarshal(content)
  def content.links
    []
  end
  content
end