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.



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

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



210
211
212
# File 'lib/toto.rb', line 210

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

#to_htmlObject Also known as: to_s



214
215
216
# File 'lib/toto.rb', line 214

def to_html
  super(:archives, @config)
end