Module: Retter::Page::Base

Includes:
Site
Included in:
Article, Entries, Entry, Feed, Index, Profile, Retter::Preprint
Defined in:
lib/retter/page/base.rb

Defined Under Namespace

Classes: ViewContext

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Site

#config, #entries, #load, #reset!

Methods included from Configurable

#configurable, #define_configurable_method, #define_instance_shortcut_method

Instance Attribute Details

#path_prefixObject (readonly)

Returns the value of attribute path_prefix.



12
13
14
# File 'lib/retter/page/base.rb', line 12

def path_prefix
  @path_prefix
end

#titleObject (readonly)

Returns the value of attribute title.



12
13
14
# File 'lib/retter/page/base.rb', line 12

def title
  @title
end

Instance Method Details

#bindObject



19
20
21
22
23
24
25
26
27
28
# File 'lib/retter/page/base.rb', line 19

def bind
  context = ViewContext.new
  part    = Tilt.new(
    template_path.to_path,
    ugly: true,
    filename: template_path.to_path
  ).render(context)

  print part
end

#initializeObject



14
15
16
17
# File 'lib/retter/page/base.rb', line 14

def initialize
  @path_prefix = './'
  @title       = config.title
end

#pathObject

Raises:

  • (NotImplementedError)


30
31
32
# File 'lib/retter/page/base.rb', line 30

def path
  raise NotImplementedError
end

#template_pathObject

Raises:

  • (NotImplementedError)


34
35
36
# File 'lib/retter/page/base.rb', line 34

def template_path
  raise NotImplementedError
end