Class: Campo::Literal

Inherits:
Base
  • Object
show all
Defined in:
lib/campo.rb

Overview

add whatever you need to with a literal

Constant Summary

Constants inherited from Base

Base::DEFAULT

Instance Attribute Summary

Attributes inherited from Base

#attributes, #fields

Attributes included from Childish

#parent

Instance Method Summary collapse

Methods inherited from Base

#labelled, #on_output, #output, output, quotable, unhash

Methods included from Convenience

#bit_of_ruby, #checkbox, #fieldset, #input, #literal, #radio, #select, #submit, #text, #textarea

Methods included from Iding

#id_tag

Methods included from Childish

#push=

Constructor Details

#initialize(s) ⇒ Literal

Returns a new instance of Literal.



325
326
327
328
329
330
331
332
333
# File 'lib/campo.rb', line 325

def initialize( s )
  super( nil ) # no name needed
  @s = s

  self.on_output do |n=0, tab=2|
    (" " * n * tab) + @s
  end
  self
end