Class: Rayo::Models::StatusPage

Inherits:
Page
  • Object
show all
Defined in:
lib/rayo/models/status_page.rb

Instance Attribute Summary

Attributes inherited from Page

#lang, #parent, #path, #storage

Instance Method Summary collapse

Methods inherited from Page

#[], #child, #children, #descendant, #find_part, #layout, #parser, #parts, #relative, #render

Constructor Details

#initialize(storage, root, path, status) ⇒ StatusPage

Returns a new instance of StatusPage.



5
6
7
8
9
# File 'lib/rayo/models/status_page.rb', line 5

def initialize( storage, root, path, status )
  super( storage, root, root.lang, path )

  @status = status
end

Instance Method Details

#contextObject



19
20
21
22
23
24
25
# File 'lib/rayo/models/status_page.rb', line 19

def context
  return @context if @context

  @context = @parent ? @parent.context.merge({ 'status' => @status }) : { 'status' => @status }
  @context.merge! load_context( file ) if file
  @context
end

#directoriesObject



11
12
13
# File 'lib/rayo/models/status_page.rb', line 11

def directories
  []
end

#fileObject



15
16
17
# File 'lib/rayo/models/status_page.rb', line 15

def file
  @file ||= @storage.find_page_file( @parent.directories, @lang, @status.to_s )
end

#paramsObject



27
28
29
# File 'lib/rayo/models/status_page.rb', line 27

def params
  { 'path' => path }
end