Class: NoticeSys::Main

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

Instance Method Summary collapse

Constructor Details

#initialize(basepath, db_basepath, xslfile, statuscss_url, statuslistcss_url, weblet_file, static_urlbase, urlbase, weblet_cssfile, debug: false) ⇒ Main

Returns a new instance of Main.



617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
# File 'lib/noticesys.rb', line 617

def initialize(basepath, db_basepath, xslfile, statuscss_url,
               statuslistcss_url, weblet_file, static_urlbase,
               urlbase, weblet_cssfile, debug: false)

  weblet_file ||= File.join(File.dirname(__FILE__), '..',
                            'data', 'microblog.txt')

  weblet = Weblet.new(weblet_file)

  @status = StatusView.new(basepath, xslfile, statuscss_url, weblet)

  @statuslist = StatusListView.new(basepath, statuslistcss_url,
                                   static_urlbase, weblet)

  @hashtag = HashtagQueryView.new(basepath, db_basepath,
                                  statuslistcss_url, weblet,
                                  static_urlbase, urlbase, debug: debug)

  @search = SearchQueryView.new(basepath, db_basepath, statuslistcss_url,
                                weblet, static_urlbase, urlbase)

  weblet_cssfile ||= File.join(File.dirname(__FILE__), '..',
                            'data', 'css.txt')
  @css = CssView.new(weblet_cssfile)

end

Instance Method Details

#hashtag_query(s, referer) ⇒ Object



660
661
662
# File 'lib/noticesys.rb', line 660

def hashtag_query(s, referer)
  @hashtag.render s, referer
end

#notice_cssObject



644
645
646
# File 'lib/noticesys.rb', line 644

def notice_css()
  @css.notice_css()
end

#noticelist_cssObject



648
649
650
# File 'lib/noticesys.rb', line 648

def noticelist_css()
  @css.noticelist_css()
end

#search_query(s, referer) ⇒ Object



664
665
666
# File 'lib/noticesys.rb', line 664

def search_query(s, referer)
  @search.render s, referer
end

#status(topic, rawid, referer) ⇒ Object



652
653
654
# File 'lib/noticesys.rb', line 652

def status(topic, rawid, referer)
  @status.render topic, rawid, referer
end

#status_list(username) ⇒ Object



656
657
658
# File 'lib/noticesys.rb', line 656

def status_list(username)
  @statuslist.render username
end