Class: Remedy::View

Inherits:
Object
  • Object
show all
Defined in:
lib/remedy/view.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(body, header = [], footer = []) ⇒ View

Returns a new instance of View.



3
4
5
# File 'lib/remedy/view.rb', line 3

def initialize body, header = [], footer = []
  @header, @body, @footer = header, body, footer
end

Instance Attribute Details

#bodyObject

Returns the value of attribute body.



6
7
8
# File 'lib/remedy/view.rb', line 6

def body
  @body
end

Returns the value of attribute footer.



6
7
8
# File 'lib/remedy/view.rb', line 6

def footer
  @footer
end

#headerObject

Returns the value of attribute header.



6
7
8
# File 'lib/remedy/view.rb', line 6

def header
  @header
end

#lengthObject

Returns the value of attribute length.



6
7
8
# File 'lib/remedy/view.rb', line 6

def length
  @length
end

Instance Method Details

#to_s(force_recompile = false) ⇒ Object



8
9
10
11
12
13
14
15
# File 'lib/remedy/view.rb', line 8

def to_s force_recompile = false
  unless @view.nil? || force_recompile then
    @view
  else
    reset_length!
    @view = compile!
  end
end