summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2013-01-16 21:21:42 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2013-01-16 21:21:42 +0100
commit8d358b40bdbdc6fed6870e82a28d6043d59ca74c (patch)
tree936037a6568856d1e812333ef3098bbef8a2d747
parent85ad0e2b9aa383fc3d152000b57633ad7e270af2 (diff)
downloadzorglub-8d358b40bdbdc6fed6870e82a28d6043d59ca74c.zip
zorglub-8d358b40bdbdc6fed6870e82a28d6043d59ca74c.tar.gz
Node: replace state method by @state
-rw-r--r--lib/zorglub/node.rb19
1 files changed, 7 insertions, 12 deletions
diff --git a/lib/zorglub/node.rb b/lib/zorglub/node.rb
index be035c6..9572503 100644
--- a/lib/zorglub/node.rb
+++ b/lib/zorglub/node.rb
@@ -254,7 +254,7 @@ module Zorglub
#
end
#
- attr_reader :request, :response, :content, :mime
+ attr_reader :request, :response, :content, :mime, :state
#
def initialize env, options
@env = env
@@ -265,11 +265,6 @@ module Zorglub
self.class.cli_vals.each do |s,v| cli_val s, *v end
end
#
- def state state=nil
- @options[:state] = state unless state.nil?
- @options[:state]
- end
- #
def realize!
catch(:stop_realize) {
feed!
@@ -281,9 +276,9 @@ module Zorglub
end
#
def feed!
- state :pre_cb
+ @state = :pre_cb
self.class.call_before_hooks self
- state :meth
+ @state = :meth
@content = self.send @options[:method], *@options[:args]
static_path = static
if static_path.nil?
@@ -291,9 +286,9 @@ module Zorglub
else
static_page! static_path
end
- state :post_cb
+ @state = :post_cb
self.class.call_after_hooks self
- state :finished
+ @state = :finished
return @content, @mime
end
#
@@ -317,10 +312,10 @@ module Zorglub
v, l, debug = view, layout, app.opt(:debug)
puts " * "+(File.exists?(l) ? 'use layout' : 'not found layout')+" : "+l if debug
puts " * "+(File.exists?(v) ? 'use view ' : 'not found view ')+" : "+v if debug
- state (@options[:layout].nil? ? :partial : :view)
+ @state = (@options[:layout].nil? ? :partial : :view)
@content, mime = e.call v, self if e and File.exists? v
@mime = mime unless mime.nil?
- state :layout
+ @state = :layout
@content, mime = e.call l, self if e and File.exists? l
@mime = mime unless mime.nil?
end