Class: Medie::OpenSearch::Descriptor

Inherits:
Object
  • Object
show all
Defined in:
lib/restfulie/client/ext/open_search_ext.rb

Instance Method Summary collapse

Instance Method Details

#use(content_type) ⇒ Object



5
6
7
8
9
10
11
12
13
# File 'lib/restfulie/client/ext/open_search_ext.rb', line 5

def use(content_type)
  uri = urls.find do |url|
    url["type"]==content_type
  end
  return nil if uri.nil?
    
  base_uri, params_pattern = extract_uri(uri)
  Restfulie.at(base_uri).accepts(content_type).open_search.with_pattern(params_pattern)
end