Class: Campo::Haml_Ruby_Insert
Constant Summary
Constants inherited from Base
Instance Attribute Summary
Attributes inherited from Base
Attributes included from Childish
Instance Method Summary collapse
-
#initialize(s) ⇒ Haml_Ruby_Insert
constructor
A new instance of Haml_Ruby_Insert.
Methods inherited from Base
#labelled, #on_output, #output, output, quotable, unhash
Methods included from Convenience
#bit_of_ruby, #checkbox, #fieldset, #input, #literal, #password, #radio, #select, #submit, #text, #textarea
Methods included from Iding
Methods included from Childish
Constructor Details
#initialize(s) ⇒ Haml_Ruby_Insert
Returns a new instance of Haml_Ruby_Insert.
318 319 320 321 322 323 324 325 326 |
# File 'lib/campo.rb', line 318 def initialize( s ) raise ArgumentError, "you may only pass a string to Haml_Ruby_Insert/bit_of_ruby" unless s.kind_of?( String ) super( nil ) # no name needed @s = s.start_with?( '=' ) ? s : "= " + s.to_s self.on_output do |n=0, tab=2| (" " * n * tab) + @s end end |