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.



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

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



218
219
220
# File 'lib/toto.rb', line 218

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

#to_htmlObject Also known as: to_s



222
223
224
# File 'lib/toto.rb', line 222

def to_html
  super(:archives, @config)
end