Method: Webmaster::Base#inspect
- Defined in:
- lib/webmaster/base.rb
#inspect ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/webmaster/base.rb', line 28 def inspect inspection = if self.respond_to?(:attributes) && self.attributes.any? self.attributes.collect { |attribute, value| "#{attribute}: #{value}" if value.present? }.compact.join(', ') else self.instance_variables.map{ |variable| "#{variable}: #{instance_variable_get(variable).inspect}" }.compact.join(', ') end "#<#{self.class} #{inspection}>" end |