Method: Inversion::Template::SubscribeTag#initialize

Defined in:
lib/inversion/template/subscribetag.rb

#initialize(body, line = nil, column = nil) ⇒ SubscribeTag

Create a new SubscribeTag with the given body.


33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/inversion/template/subscribetag.rb', line 33

def initialize( body, line=nil, column=nil )
	super

	unless self.body =~ /^([a-z]\w+)(?:\s*\|\|\s*(.+))?$/
		raise Inversion::ParseError,
			"malformed subscribe: %p" % [ self.body ]
	end

	key, default = $1, $2

	@key = key.to_sym
	@content = []
	@default = default
end