Class: ModelFormatting::CodePart

Inherits:
Part
  • Object
show all
Defined in:
lib/model_formatting.rb

Instance Attribute Summary collapse

Attributes inherited from Part

#format

Instance Method Summary collapse

Methods inherited from Part

#==, #compact!, #formatted_string, #inspect, #simple_string

Constructor Details

#initialize(format, class_name, *args) ⇒ CodePart

Returns a new instance of CodePart.



49
50
51
52
# File 'lib/model_formatting.rb', line 49

def initialize(format, class_name, *args)
  @class_name = class_name
  super(format, *args)
end

Instance Attribute Details

#class_nameObject (readonly)

Returns the value of attribute class_name.



47
48
49
# File 'lib/model_formatting.rb', line 47

def class_name
  @class_name
end

Instance Method Details

#<<(s) ⇒ Object



54
55
56
# File 'lib/model_formatting.rb', line 54

def <<(s)
  super CGI.escapeHTML(s)
end