Class: RubySlippers::Engine::Archives

Inherits:
Array show all
Includes:
Template
Defined in:
lib/ruby_slippers/archives.rb

Instance Method Summary collapse

Methods included from Template

included, #markdown, #method_missing

Methods inherited from Array

#in_groups, #in_groups_of, #split

Constructor Details

#initialize(articles, config) ⇒ Archives

Returns a new instance of Archives.



6
7
8
9
# File 'lib/ruby_slippers/archives.rb', line 6

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 RubySlippers::Engine::Template

Instance Method Details

#[](a) ⇒ Object



11
12
13
# File 'lib/ruby_slippers/archives.rb', line 11

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

#to_htmlObject Also known as: to_s



15
16
17
# File 'lib/ruby_slippers/archives.rb', line 15

def to_html
  super(:archives, @config)
end