Module: BlacklightOembed::Solr::Document::OembedRich

Defined in:
lib/blacklight_oembed/solr/document/oembed_rich.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.extended(document) ⇒ Object



2
3
4
# File 'lib/blacklight_oembed/solr/document/oembed_rich.rb', line 2

def self.extended(document)
  BlacklightOembed::Solr::Document::OembedRich.register_export_formats( document )
end

.register_export_formats(document) ⇒ Object



6
7
# File 'lib/blacklight_oembed/solr/document/oembed_rich.rb', line 6

def self.register_export_formats(document)
end

Instance Method Details

#oembed_typeObject



27
28
29
# File 'lib/blacklight_oembed/solr/document/oembed_rich.rb', line 27

def oembed_type
  'rich'
end

#to_oembed(oembed) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/blacklight_oembed/solr/document/oembed_rich.rb', line 9

def to_oembed(oembed)
  semantic_values = self.to_semantic_values
  ({
    :version => '1.0',
    :type => oembed_type,
    :provider_name => '',
    :provider_url => '',
    :title => semantic_values[:title],
    :author_name => semantic_values[:author],
    :html => (Proc.new do |controller| 
      template = controller.send(:view_context)
      template.with_format(:html) { 
        template.render_document_partial(self, 'oembed') 
      } 
    end)
  }).merge(oembed)
end