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.



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

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.



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

def class_name
  @class_name
end

Instance Method Details

#<<(s) ⇒ Object



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

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