Class: RubySlippers::Engine::Archives
- Includes:
- Template
- Defined in:
- lib/ruby_slippers/archives.rb
Instance Method Summary collapse
- #[](a) ⇒ Object
-
#initialize(articles, config) ⇒ Archives
constructor
A new instance of Archives.
- #to_html ⇒ Object (also: #to_s)
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_html ⇒ Object Also known as: to_s
15 16 17 |
# File 'lib/ruby_slippers/archives.rb', line 15 def to_html super(:archives, @config) end |