Class: Hash

Inherits:
Object
  • Object
show all
Defined in:
lib/accessibility/qualifier.rb

Overview

AXElements extensions to Hash.

Instance Method Summary collapse

Instance Method Details

#ax_ppString

Format the hash for AXElements pretty printing.

Returns:

  • (String)


150
151
152
153
154
155
156
157
158
159
160
161
162
# File 'lib/accessibility/qualifier.rb', line 150

def ax_pp
  return '' if empty?

  list = map { |k, v|
    case v
    when Hash
      "#{k}#{v.ax_pp}"
    else
      "#{k}: #{v.inspect}"
    end
  }
  "(#{list.join(', ')})"
end