Method: OMF::Web::Widget::TextWidget#initialize

Defined in:
lib/omf-web/widget/text/text_widget.rb

#initialize(opts) ⇒ TextWidget

Returns a new instance of TextWidget.



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/omf-web/widget/text/text_widget.rb', line 16

def initialize(opts)
  opts = opts.dup # not sure why we may need to this. Is this hash used anywhere else?
  super opts      

  unless (content_descr = opts[:content])
    raise "Missing 'content' option in '#{opts.inspect}'"
  end      
  # if content_descr.is_a? OMF::Web::ContentProxy
    # self.content_proxy = content_descr
  # else    
    # #self.content_proxy = OMF::Web::ContentRepository[opts].load(content_descr)
    # self.content_proxy = OMF::Web::ContentRepository.create_content_proxy_for(content_descr, opts)
  # end
  self.content_proxy = OMF::Web::ContentRepository.create_content_proxy_for(content_descr, opts)
end