Method: ActiveEntity::Core#inspect
- Defined in:
- lib/active_entity/core.rb
#inspect ⇒ Object
Returns the contents of the record as a nicely formatted string.
252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 |
# File 'lib/active_entity/core.rb', line 252 def inspect # We check defined?(@attributes) not to issue warnings if the object is # allocated but not initialized. inspection = if defined?(@attributes) && @attributes self.class.attribute_names.collect do |name| if has_attribute?(name) attr = _read_attribute(name) value = if attr.nil? attr.inspect else attr = format_for_inspect(attr) inspection_filter.filter_param(name, attr) end "#{name}: #{value}" end end.compact.join(", ") else "not initialized" end "#<#{self.class} #{inspection}>" end |