Class: Toto::Archives

Inherits:
Array show all
Includes:
Template
Defined in:
lib/toto.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.



198
199
200
201
# File 'lib/toto.rb', line 198

def initialize articles, config
  self.replace articles
  @config = config
end

Dynamic Method Handling

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

Instance Method Details

#[](a) ⇒ Object



203
204
205
# File 'lib/toto.rb', line 203

def [] a
  a.is_a?(Range) ? self.class.new(self.slice(a) || [], @config) : super
end

#to_htmlObject Also known as: to_s



207
208
209
# File 'lib/toto.rb', line 207

def to_html
  super(:archives, @config)
end