Sha256: a0b3dca63a85097066814df57e212d9e2cc0b1200e080d492d11647a08991247

Contents?: true

Size: 523 Bytes

Versions: 7

Compression:

Stored size: 523 Bytes

Contents

module Bankscrap
  module Utils
    module Inspectable
      def inspect
        attributes = inspect_attributes.reject do |x|
          begin
            attribute = send x
            !attribute || (attribute.respond_to?(:empty?) && attribute.empty?)
          rescue NoMethodError
            true
          end
        end.map do |attribute|
          "#{attribute}: #{send(attribute).inspect}"
        end.join ' '
        "#<#{self.class.name}:#{format('0x%x', object_id)} #{attributes}>"
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
bankscrap-2.1.1 lib/bankscrap/utils/inspectable.rb
bankscrap-2.1.0 lib/bankscrap/utils/inspectable.rb
bankscrap-2.0.6 lib/bankscrap/utils/inspectable.rb
bankscrap-2.0.5 lib/bankscrap/utils/inspectable.rb
bankscrap-2.0.4 lib/bankscrap/utils/inspectable.rb
bankscrap-2.0.3 lib/bankscrap/utils/inspectable.rb
bankscrap-2.0.2 lib/bankscrap/utils/inspectable.rb