Class: TinMan::Archives

Inherits:
Array
  • Object
show all
Includes:
Template
Defined in:
lib/tinman.rb

Instance Method Summary collapse

Methods included from Template

included, #method_missing, #redcloth

Constructor Details

#initialize(articles, config) ⇒ Archives

Returns a new instance of Archives.



198
199
200
201
# File 'lib/tinman.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 TinMan::Template

Instance Method Details

#[](a) ⇒ Object



203
204
205
# File 'lib/tinman.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/tinman.rb', line 207

def to_html
  super(:archives, @config)
end