Class: Cat::Skeleton

Inherits:
Object
  • Object
show all
Defined in:
lib/cat/skeleton.rb

Instance Method Summary collapse

Constructor Details

#initialize(skin, &block) ⇒ Skeleton

Returns a new instance of Skeleton.



6
7
8
9
# File 'lib/cat/skeleton.rb', line 6

def initialize(skin, &block)
  @skin = skin
  @node = SkeletonNode.new("cat", &block)
end

Instance Method Details

#catObject



19
20
21
# File 'lib/cat/skeleton.rb', line 19

def cat
  @node.expand
end

#generateObject



23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/cat/skeleton.rb', line 23

def generate
  Slim::Template.new {
    %{
html
  head
title Loading Cat
link(href="skin.css" rel="stylesheet")
  body
#{cat}
  }
  }.render
end

#skinsObject



15
16
17
# File 'lib/cat/skeleton.rb', line 15

def skins
  @node.skin
end

#update(&block) ⇒ Object



11
12
13
# File 'lib/cat/skeleton.rb', line 11

def update(&block)
  @node = SkeletonNode.new("cat", &block)
end