Class: SatoriLikeDictionary::Entry

Inherits:
Array
  • Object
show all
Includes:
Renderer
Defined in:
lib/satori_like_dictionary.rb

Overview

entry (*)

Constant Summary

Constants included from Renderer

Renderer::NUMBERS

Instance Method Summary collapse

Methods included from Renderer

#render, #render_template

Instance Method Details

#render_base(events, request) ⇒ Object

Parameters:

  • events (Events)

    events definition

  • request (OpenStruct)

    request hash


214
215
216
# File 'lib/satori_like_dictionary.rb', line 214

def render_base(events, request)
  '\1' + super
end

#to_templateString

to template

Returns:

  • (String)

    template


220
221
222
223
224
225
226
227
# File 'lib/satori_like_dictionary.rb', line 220

def to_template
  still_empty = true
  reverse.reject do |element| # remove last empty lines
    still_empty = still_empty && element.is_a?(Line) && element.empty?
  end.map do |element|
    element.to_template
  end.reverse.join('').chomp
end