Class: Glinda::Archives

Inherits:
Array
  • Object
show all
Includes:
Template, NewRelic::Agent::MethodTracer
Defined in:
lib/glinda.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.



278
279
280
281
# File 'lib/glinda.rb', line 278

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 Glinda::Template

Instance Method Details

#[](a) ⇒ Object



283
284
285
# File 'lib/glinda.rb', line 283

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

#to_htmlObject Also known as: to_s



287
288
289
# File 'lib/glinda.rb', line 287

def to_html
  super(:archives, @config)
end