Class: TotoBongo::Archives

Inherits:
Array
  • Object
show all
Includes:
Template
Defined in:
lib/toto-bongo.rb

Instance Method Summary collapse

Methods included from Template

included, #markdown, #method_missing

Constructor Details

#initialize(articles, config) ⇒ Archives

Returns a new instance of Archives.



320
321
322
323
324
# File 'lib/toto-bongo.rb', line 320

def initialize articles, config
  TotoBongo::logger.debug("Archives::initialize")
  self.replace articles
  @config = config
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class TotoBongo::Template

Instance Method Details

#[](a) ⇒ Object



326
327
328
329
# File 'lib/toto-bongo.rb', line 326

def [] a
  TotoBongo::logger.debug("Archives::[]: a = #{a}")
  a.is_a?(Range) ? self.class.new(self.slice(a) || [], @config) : super
end

#to_htmlObject Also known as: to_s



331
332
333
334
# File 'lib/toto-bongo.rb', line 331

def to_html
  TotoBongo::logger.debug("Archives::to_html")
  super(:archives, @config)
end