Class: Restfulie::Common::Representation::OpenSearch

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

Constant Summary collapse

@@media_type_name =
'application/opensearchdescription+xml'
@@headers =
{ 
  :get  => { 'Accept'       => media_type_name },
  :post => { }
}

Instance Method Summary collapse

Instance Method Details

#marshal(content) ⇒ Object



41
42
43
# File 'lib/opensearch_mediatype.rb', line 41

def marshal(content)
  content
end

prepares a link request element based on a relation.



46
47
48
49
50
51
52
# File 'lib/opensearch_mediatype.rb', line 46

def prepare_link_for(link)
  if link.rel=="search"
    OpenSearchEngine.new(link.href)
  else
    link
  end
end

#unmarshal(content) ⇒ Object

Convert raw string to rAtom instances



37
38
39
# File 'lib/opensearch_mediatype.rb', line 37

def unmarshal(content)
  Hash.from_xml(content)
end