Sha256: f99b9d9481f0a13107ad744d992f2e71bfe30fd0a8f720be6f0e3e8bdeb0a93c
Contents?: true
Size: 873 Bytes
Versions: 5
Compression:
Stored size: 873 Bytes
Contents
module Rack module Blogengine # # Document Class # Contains attributes path, html, title, date # # @author [benny] # class Document attr_accessor :path, :html, :title, :date def to_hash hash = {} instance_variables.each do |var| unless var.to_s == '@title' || var.to_s == '@date' hash[var.to_s.delete('@').to_sym] = instance_variable_get(var) end end hash end def exec_content_operator(documents, target) @html.scan(/\{\%(.*?)\%\}/).each do |contentoperator| contentoperator = contentoperator[0].strip.to_sym operator = Operator.new(target) operatorhtml = operator.send(contentoperator, documents, @html) @html['{% ' + contentoperator.to_s + ' %}'] = operatorhtml end end end end end
Version data entries
5 entries across 5 versions & 1 rubygems