Class: PageTemplate::CommentCommand

Inherits:
Command
  • Object
show all
Defined in:
lib/PageTemplate/commands.rb

Overview

CommentCommand is a command that just returns nothing for its output, allowing the designer to populate their pages with PageTemplate-style comments as well.

Instance Attribute Summary

Attributes inherited from Command

#called_as

Instance Method Summary collapse

Constructor Details

#initialize(comment = '') ⇒ CommentCommand

Save the comment for to_s


48
49
50
# File 'lib/PageTemplate/commands.rb', line 48

def initialize(comment='')
  @comment = comment
end

Instance Method Details

#output(namespace = nil) ⇒ Object

output returns nothing.


44
45
46
# File 'lib/PageTemplate/commands.rb', line 44

def output(namespace=nil)
  ''
end

#to_sObject


51
52
53
# File 'lib/PageTemplate/commands.rb', line 51

def to_s
  "[ Comment: #{@comment} ]"
end