Sha256: 7dcda44ceef6514634a368012c5206897b72be4ea1b91abc6447650ba86e1a69
Contents?: true
Size: 504 Bytes
Versions: 304
Compression:
Stored size: 504 Bytes
Contents
module Gherkin module Formatter class Hashable def to_hash instance_variables.inject({}) do |hash, ivar| value = instance_variable_get(ivar) value = value.to_hash if value.respond_to?(:to_hash) if Array === value value = value.map do |e| e.respond_to?(:to_hash) ? e.to_hash : e end end hash[ivar[1..-1]] = value unless [[], nil].index(value) hash end end end end end
Version data entries
304 entries across 299 versions & 9 rubygems